diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 6ea7c1ce..c95ac087 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 7bffa198-5d29-4efa-9942-d549cc832085 management: - docChecksum: a66063e3c32337bb9f66b137be728988 - docVersion: 10.20.13 - speakeasyVersion: 1.611.1 - generationVersion: 2.694.1 - releaseVersion: 0.29.8 - configChecksum: 0c3440055984a95250996ce025be44e5 + docChecksum: 14b5eaa4ac48d4336800b2e5e5f40937 + docVersion: 10.20.16 + speakeasyVersion: 1.621.0 + generationVersion: 2.707.0 + releaseVersion: 0.29.9 + configChecksum: a7642230b4c064c7c98ea10b28ec643f repoURL: https://github.com/apideck-libraries/sdk-typescript.git installationURL: https://github.com/apideck-libraries/sdk-typescript published: true @@ -23,7 +23,7 @@ features: enumUnions: 0.1.0 envVarSecurityUsage: 0.1.2 errors: 2.86.0 - globalSecurity: 2.82.13 + globalSecurity: 2.82.14 globalSecurityCallbacks: 0.1.0 globalSecurityFlattening: 0.1.0 globalServerURLs: 2.82.5 @@ -38,7 +38,7 @@ features: responseFormat: 0.2.3 retries: 2.83.0 sdkHooks: 0.3.0 - tests: 0.17.1 + tests: 0.17.2 typeOverrides: 2.81.1 unions: 2.85.11 uploadStreams: 0.1.0 @@ -49,6 +49,10 @@ generatedFiles: - RUNTIMES.md - USAGE.md - docs/lib/utils/retryconfig.md + - docs/models/components/accountingbankaccount.md + - docs/models/components/accountingbankaccountaccounttype.md + - docs/models/components/accountingbankaccountinput.md + - docs/models/components/accountingbankaccountstatus.md - docs/models/components/accountingdepartment.md - docs/models/components/accountingdepartmentinput.md - docs/models/components/accountingdepartmentsfilter.md @@ -110,6 +114,9 @@ generatedFiles: - docs/models/components/bankaccount.md - docs/models/components/bankaccount1.md - docs/models/components/bankaccount1accounttype.md + - docs/models/components/bankaccountsfilter.md + - docs/models/components/bankaccountsfilterstatus.md + - docs/models/components/bankaccountssort.md - docs/models/components/bankaccounttype.md - docs/models/components/bankfeedaccount.md - docs/models/components/bankfeedaccountinput.md @@ -205,6 +212,7 @@ generatedFiles: - docs/models/components/createapplicantresponse.md - docs/models/components/createapplicationresponse.md - docs/models/components/createattachmentresponse.md + - docs/models/components/createbankaccountresponse.md - docs/models/components/createbankfeedaccountresponse.md - docs/models/components/createbankfeedstatementresponse.md - docs/models/components/createbillpaymentresponse.md @@ -300,6 +308,7 @@ generatedFiles: - docs/models/components/deleteapplicantresponse.md - docs/models/components/deleteapplicationresponse.md - docs/models/components/deleteattachmentresponse.md + - docs/models/components/deletebankaccountresponse.md - docs/models/components/deletebankfeedaccountresponse.md - docs/models/components/deletebankfeedstatementresponse.md - docs/models/components/deletebillpaymentresponse.md @@ -447,6 +456,8 @@ generatedFiles: - docs/models/components/getattachmentresponse.md - docs/models/components/getattachmentsresponse.md - docs/models/components/getbalancesheetresponse.md + - docs/models/components/getbankaccountresponse.md + - docs/models/components/getbankaccountsresponse.md - docs/models/components/getbankfeedaccountresponse.md - docs/models/components/getbankfeedaccountsresponse.md - docs/models/components/getbankfeedstatementresponse.md @@ -751,6 +762,7 @@ generatedFiles: - docs/models/components/simpleformfieldoptionvalue.md - docs/models/components/sociallink.md - docs/models/components/sociallinks.md + - docs/models/components/sortby.md - docs/models/components/sortdirection.md - docs/models/components/stage.md - docs/models/components/stages.md @@ -814,6 +826,7 @@ generatedFiles: - docs/models/components/updateactivityresponse.md - docs/models/components/updateapplicantresponse.md - docs/models/components/updateapplicationresponse.md + - docs/models/components/updatebankaccountresponse.md - docs/models/components/updatebankfeedaccountresponse.md - docs/models/components/updatebankfeedstatementresponse.md - docs/models/components/updatebillpaymentresponse.md @@ -920,6 +933,21 @@ generatedFiles: - docs/models/operations/accountingbalancesheetoneglobals.md - docs/models/operations/accountingbalancesheetonerequest.md - docs/models/operations/accountingbalancesheetoneresponse.md + - docs/models/operations/accountingbankaccountsaddglobals.md + - docs/models/operations/accountingbankaccountsaddrequest.md + - docs/models/operations/accountingbankaccountsaddresponse.md + - docs/models/operations/accountingbankaccountsallglobals.md + - docs/models/operations/accountingbankaccountsallrequest.md + - docs/models/operations/accountingbankaccountsallresponse.md + - docs/models/operations/accountingbankaccountsdeleteglobals.md + - docs/models/operations/accountingbankaccountsdeleterequest.md + - docs/models/operations/accountingbankaccountsdeleteresponse.md + - docs/models/operations/accountingbankaccountsoneglobals.md + - docs/models/operations/accountingbankaccountsonerequest.md + - docs/models/operations/accountingbankaccountsoneresponse.md + - docs/models/operations/accountingbankaccountsupdateglobals.md + - docs/models/operations/accountingbankaccountsupdaterequest.md + - docs/models/operations/accountingbankaccountsupdateresponse.md - docs/models/operations/accountingbankfeedaccountsaddglobals.md - docs/models/operations/accountingbankfeedaccountsaddrequest.md - docs/models/operations/accountingbankfeedaccountsaddresponse.md @@ -1800,6 +1828,7 @@ generatedFiles: - docs/sdks/ats/README.md - docs/sdks/attachments/README.md - docs/sdks/balancesheet/README.md + - docs/sdks/bankaccounts/README.md - docs/sdks/bankfeedaccounts/README.md - docs/sdks/bankfeedstatements/README.md - docs/sdks/billpayments/README.md @@ -1901,6 +1930,7 @@ generatedFiles: - src/__tests__/assertions.ts - src/__tests__/attachments.test.ts - src/__tests__/balancesheet.test.ts + - src/__tests__/bankaccounts.test.ts - src/__tests__/bankfeedaccounts.test.ts - src/__tests__/bankfeedstatements.test.ts - src/__tests__/billpayments.test.ts @@ -1965,6 +1995,7 @@ generatedFiles: - src/__tests__/mockserver/internal/handler/generated_handler.go - src/__tests__/mockserver/internal/handler/generated_handlers.go - src/__tests__/mockserver/internal/handler/pathdeleteaccountingattachmentsreferencetypereferenceidid.go + - src/__tests__/mockserver/internal/handler/pathdeleteaccountingbankaccountsid.go - src/__tests__/mockserver/internal/handler/pathdeleteaccountingbankfeedaccountsid.go - src/__tests__/mockserver/internal/handler/pathdeleteaccountingbankfeedstatementsid.go - src/__tests__/mockserver/internal/handler/pathdeleteaccountingbillpaymentsid.go @@ -2019,6 +2050,8 @@ generatedFiles: - src/__tests__/mockserver/internal/handler/pathgetaccountingattachmentsreferencetypereferenceidid.go - src/__tests__/mockserver/internal/handler/pathgetaccountingattachmentsreferencetypereferenceididdownload.go - src/__tests__/mockserver/internal/handler/pathgetaccountingbalancesheet.go + - src/__tests__/mockserver/internal/handler/pathgetaccountingbankaccounts.go + - src/__tests__/mockserver/internal/handler/pathgetaccountingbankaccountsid.go - src/__tests__/mockserver/internal/handler/pathgetaccountingbankfeedaccounts.go - src/__tests__/mockserver/internal/handler/pathgetaccountingbankfeedaccountsid.go - src/__tests__/mockserver/internal/handler/pathgetaccountingbankfeedstatements.go @@ -2152,6 +2185,7 @@ generatedFiles: - src/__tests__/mockserver/internal/handler/pathgetwebhooklogs.go - src/__tests__/mockserver/internal/handler/pathgetwebhookwebhooks.go - src/__tests__/mockserver/internal/handler/pathgetwebhookwebhooksid.go + - src/__tests__/mockserver/internal/handler/pathpatchaccountingbankaccountsid.go - src/__tests__/mockserver/internal/handler/pathpatchaccountingbankfeedaccountsid.go - src/__tests__/mockserver/internal/handler/pathpatchaccountingbankfeedstatementsid.go - src/__tests__/mockserver/internal/handler/pathpatchaccountingbillpaymentsid.go @@ -2201,6 +2235,7 @@ generatedFiles: - src/__tests__/mockserver/internal/handler/pathpatchvaultconnectionsunifiedapiserviceidresourceconfig.go - src/__tests__/mockserver/internal/handler/pathpatchvaultconsumersconsumerid.go - src/__tests__/mockserver/internal/handler/pathpatchwebhookwebhooksid.go + - src/__tests__/mockserver/internal/handler/pathpostaccountingbankaccounts.go - src/__tests__/mockserver/internal/handler/pathpostaccountingbankfeedaccounts.go - src/__tests__/mockserver/internal/handler/pathpostaccountingbankfeedstatements.go - src/__tests__/mockserver/internal/handler/pathpostaccountingbillpayments.go @@ -2264,6 +2299,7 @@ generatedFiles: - src/__tests__/mockserver/internal/logging/logger.go - src/__tests__/mockserver/internal/logging/oas_operation.go - src/__tests__/mockserver/internal/logging/oas_operation_call.go + - src/__tests__/mockserver/internal/sdk/models/components/accountingbankaccount.go - src/__tests__/mockserver/internal/sdk/models/components/accountingdepartment.go - src/__tests__/mockserver/internal/sdk/models/components/accountingdepartmentsfilter.go - src/__tests__/mockserver/internal/sdk/models/components/accountinglocation.go @@ -2298,6 +2334,8 @@ generatedFiles: - src/__tests__/mockserver/internal/sdk/models/components/balancesheetfilter.go - src/__tests__/mockserver/internal/sdk/models/components/bankaccount.go - src/__tests__/mockserver/internal/sdk/models/components/bankaccount1.go + - src/__tests__/mockserver/internal/sdk/models/components/bankaccountsfilter.go + - src/__tests__/mockserver/internal/sdk/models/components/bankaccountssort.go - src/__tests__/mockserver/internal/sdk/models/components/bankfeedaccount.go - src/__tests__/mockserver/internal/sdk/models/components/bankfeedstatement.go - src/__tests__/mockserver/internal/sdk/models/components/benefit.go @@ -2348,6 +2386,7 @@ generatedFiles: - src/__tests__/mockserver/internal/sdk/models/components/createapplicantresponse.go - src/__tests__/mockserver/internal/sdk/models/components/createapplicationresponse.go - src/__tests__/mockserver/internal/sdk/models/components/createattachmentresponse.go + - src/__tests__/mockserver/internal/sdk/models/components/createbankaccountresponse.go - src/__tests__/mockserver/internal/sdk/models/components/createbankfeedaccountresponse.go - src/__tests__/mockserver/internal/sdk/models/components/createbankfeedstatementresponse.go - src/__tests__/mockserver/internal/sdk/models/components/createbillpaymentresponse.go @@ -2421,6 +2460,7 @@ generatedFiles: - src/__tests__/mockserver/internal/sdk/models/components/deleteapplicantresponse.go - src/__tests__/mockserver/internal/sdk/models/components/deleteapplicationresponse.go - src/__tests__/mockserver/internal/sdk/models/components/deleteattachmentresponse.go + - src/__tests__/mockserver/internal/sdk/models/components/deletebankaccountresponse.go - src/__tests__/mockserver/internal/sdk/models/components/deletebankfeedaccountresponse.go - src/__tests__/mockserver/internal/sdk/models/components/deletebankfeedstatementresponse.go - src/__tests__/mockserver/internal/sdk/models/components/deletebillpaymentresponse.go @@ -2527,6 +2567,8 @@ generatedFiles: - src/__tests__/mockserver/internal/sdk/models/components/getattachmentresponse.go - src/__tests__/mockserver/internal/sdk/models/components/getattachmentsresponse.go - src/__tests__/mockserver/internal/sdk/models/components/getbalancesheetresponse.go + - src/__tests__/mockserver/internal/sdk/models/components/getbankaccountresponse.go + - src/__tests__/mockserver/internal/sdk/models/components/getbankaccountsresponse.go - src/__tests__/mockserver/internal/sdk/models/components/getbankfeedaccountresponse.go - src/__tests__/mockserver/internal/sdk/models/components/getbankfeedaccountsresponse.go - src/__tests__/mockserver/internal/sdk/models/components/getbankfeedstatementresponse.go @@ -2774,6 +2816,7 @@ generatedFiles: - src/__tests__/mockserver/internal/sdk/models/components/updateactivityresponse.go - src/__tests__/mockserver/internal/sdk/models/components/updateapplicantresponse.go - src/__tests__/mockserver/internal/sdk/models/components/updateapplicationresponse.go + - src/__tests__/mockserver/internal/sdk/models/components/updatebankaccountresponse.go - src/__tests__/mockserver/internal/sdk/models/components/updatebankfeedaccountresponse.go - src/__tests__/mockserver/internal/sdk/models/components/updatebankfeedstatementresponse.go - src/__tests__/mockserver/internal/sdk/models/components/updatebillpaymentresponse.go @@ -2842,6 +2885,11 @@ generatedFiles: - src/__tests__/mockserver/internal/sdk/models/operations/accountingattachmentsone.go - src/__tests__/mockserver/internal/sdk/models/operations/accountingattachmentsupload.go - src/__tests__/mockserver/internal/sdk/models/operations/accountingbalancesheetone.go + - src/__tests__/mockserver/internal/sdk/models/operations/accountingbankaccountsadd.go + - src/__tests__/mockserver/internal/sdk/models/operations/accountingbankaccountsall.go + - src/__tests__/mockserver/internal/sdk/models/operations/accountingbankaccountsdelete.go + - src/__tests__/mockserver/internal/sdk/models/operations/accountingbankaccountsone.go + - src/__tests__/mockserver/internal/sdk/models/operations/accountingbankaccountsupdate.go - src/__tests__/mockserver/internal/sdk/models/operations/accountingbankfeedaccountsadd.go - src/__tests__/mockserver/internal/sdk/models/operations/accountingbankfeedaccountsall.go - src/__tests__/mockserver/internal/sdk/models/operations/accountingbankfeedaccountsdelete.go @@ -3185,6 +3233,11 @@ generatedFiles: - src/funcs/accountingAttachmentsList.ts - src/funcs/accountingAttachmentsUpload.ts - src/funcs/accountingBalanceSheetGet.ts + - src/funcs/accountingBankAccountsCreate.ts + - src/funcs/accountingBankAccountsDelete.ts + - src/funcs/accountingBankAccountsGet.ts + - src/funcs/accountingBankAccountsList.ts + - src/funcs/accountingBankAccountsUpdate.ts - src/funcs/accountingBankFeedAccountsCreate.ts - src/funcs/accountingBankFeedAccountsDelete.ts - src/funcs/accountingBankFeedAccountsGet.ts @@ -3492,6 +3545,7 @@ generatedFiles: - src/lib/sdks.ts - src/lib/security.ts - src/lib/url.ts + - src/models/components/accountingbankaccount.ts - src/models/components/accountingdepartment.ts - src/models/components/accountingdepartmentsfilter.ts - src/models/components/accountinglocation.ts @@ -3525,6 +3579,8 @@ generatedFiles: - src/models/components/balancesheetfilter.ts - src/models/components/bankaccount.ts - src/models/components/bankaccount1.ts + - src/models/components/bankaccountsfilter.ts + - src/models/components/bankaccountssort.ts - src/models/components/bankfeedaccount.ts - src/models/components/bankfeedstatement.ts - src/models/components/benefit.ts @@ -3575,6 +3631,7 @@ generatedFiles: - src/models/components/createapplicantresponse.ts - src/models/components/createapplicationresponse.ts - src/models/components/createattachmentresponse.ts + - src/models/components/createbankaccountresponse.ts - src/models/components/createbankfeedaccountresponse.ts - src/models/components/createbankfeedstatementresponse.ts - src/models/components/createbillpaymentresponse.ts @@ -3648,6 +3705,7 @@ generatedFiles: - src/models/components/deleteapplicantresponse.ts - src/models/components/deleteapplicationresponse.ts - src/models/components/deleteattachmentresponse.ts + - src/models/components/deletebankaccountresponse.ts - src/models/components/deletebankfeedaccountresponse.ts - src/models/components/deletebankfeedstatementresponse.ts - src/models/components/deletebillpaymentresponse.ts @@ -3754,6 +3812,8 @@ generatedFiles: - src/models/components/getattachmentresponse.ts - src/models/components/getattachmentsresponse.ts - src/models/components/getbalancesheetresponse.ts + - src/models/components/getbankaccountresponse.ts + - src/models/components/getbankaccountsresponse.ts - src/models/components/getbankfeedaccountresponse.ts - src/models/components/getbankfeedaccountsresponse.ts - src/models/components/getbankfeedstatementresponse.ts @@ -3999,6 +4059,7 @@ generatedFiles: - src/models/components/updateactivityresponse.ts - src/models/components/updateapplicantresponse.ts - src/models/components/updateapplicationresponse.ts + - src/models/components/updatebankaccountresponse.ts - src/models/components/updatebankfeedaccountresponse.ts - src/models/components/updatebankfeedstatementresponse.ts - src/models/components/updatebillpaymentresponse.ts @@ -4078,6 +4139,11 @@ generatedFiles: - src/models/operations/accountingattachmentsone.ts - src/models/operations/accountingattachmentsupload.ts - src/models/operations/accountingbalancesheetone.ts + - src/models/operations/accountingbankaccountsadd.ts + - src/models/operations/accountingbankaccountsall.ts + - src/models/operations/accountingbankaccountsdelete.ts + - src/models/operations/accountingbankaccountsone.ts + - src/models/operations/accountingbankaccountsupdate.ts - src/models/operations/accountingbankfeedaccountsadd.ts - src/models/operations/accountingbankfeedaccountsall.ts - src/models/operations/accountingbankfeedaccountsdelete.ts @@ -4381,6 +4447,7 @@ generatedFiles: - src/sdk/ats.ts - src/sdk/attachments.ts - src/sdk/balancesheet.ts + - src/sdk/bankaccounts.ts - src/sdk/bankfeedaccounts.ts - src/sdk/bankfeedstatements.ts - src/sdk/billpayments.ts @@ -18639,7 +18706,7 @@ examples: speakeasy-default-vault-logs-all: parameters: query: - filter: {"connector_id": "crm+salesforce", "status_code": 201, "exclude_unified_apis": "vault,proxy"} + filter: {"connector_id": "crm+salesforce", "status_code": 201, "status_codes": [200, 201, 204], "exclude_unified_apis": "vault,proxy"} limit: 20 header: x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" @@ -19693,6 +19760,142 @@ examples: application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.bankAccountsAll: + speakeasy-default-accounting-bank-accounts-all: + parameters: + query: + raw: false + limit: 20 + filter: {"name": "Main Operating", "status": "active"} + sort: {"by": "updated_at", "direction": "asc"} + pass_through: {"search": "San Francisco"} + fields: "id,updated_at" + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + responses: + "200": + application/json: {"status_code": 200, "status": "OK", "service": "quickbooks", "resource": "bank-accounts", "operation": "all", "data": [{"id": "12345", "display_id": "BA-001", "name": "Main Operating Account", "account_number": "1234567890", "account_type": "checking", "bank_name": "Chase Bank", "currency": "USD", "balance": 25000, "available_balance": 24500, "overdraft_limit": 5000, "routing_number": "021000021", "iban": "GB33BUKB20201555555555", "bic": "CHASUS33", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "country": "US", "status": "active", "description": "Primary operating account for daily transactions", "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "created_at": "2020-09-30T07:43:32.000Z", "updated_at": "2020-09-30T07:43:32.000Z", "created_by": "12345", "updated_by": "12345"}], "meta": {"items_on_page": 50, "cursors": {"previous": "em9oby1jcm06OnBhZ2U6OjE=", "current": "em9oby1jcm06OnBhZ2U6OjI=", "next": "em9oby1jcm06OnBhZ2U6OjM="}}, "links": {"previous": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D", "current": "https://unify.apideck.com/crm/companies", "next": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM"}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror"} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.bankAccountsAdd: + speakeasy-default-accounting-bank-accounts-add: + parameters: + query: + raw: false + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + requestBody: + application/json: {"display_id": "BA-001", "name": "Main Operating Account", "account_number": "1234567890", "account_type": "checking", "bank_name": "Chase Bank", "currency": "USD", "balance": 25000, "available_balance": 24500, "overdraft_limit": 5000, "routing_number": "021000021", "iban": "GB33BUKB20201555555555", "bic": "CHASUS33", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "country": "US", "status": "active", "description": "Primary operating account for daily transactions", "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}]} + responses: + "201": + application/json: {"status_code": 201, "status": "Created", "service": "quickbooks", "resource": "bank-accounts", "operation": "add", "data": {"id": "12345"}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror"} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.bankAccountsOne: + speakeasy-default-accounting-bank-accounts-one: + parameters: + path: + id: "" + query: + raw: false + fields: "id,updated_at" + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + responses: + "200": + application/json: {"status_code": 200, "status": "OK", "service": "quickbooks", "resource": "bank-accounts", "operation": "one", "data": {"id": "12345", "display_id": "BA-001", "name": "Main Operating Account", "account_number": "1234567890", "account_type": "checking", "bank_name": "Chase Bank", "currency": "USD", "balance": 25000, "available_balance": 24500, "overdraft_limit": 5000, "routing_number": "021000021", "iban": "GB33BUKB20201555555555", "bic": "CHASUS33", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "country": "US", "status": "active", "description": "Primary operating account for daily transactions", "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "created_at": "2020-09-30T07:43:32.000Z", "updated_at": "2020-09-30T07:43:32.000Z", "created_by": "12345", "updated_by": "12345"}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror"} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.bankAccountsUpdate: + speakeasy-default-accounting-bank-accounts-update: + parameters: + path: + id: "" + query: + raw: false + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + requestBody: + application/json: {"display_id": "BA-001", "name": "Main Operating Account", "account_number": "1234567890", "account_type": "checking", "bank_name": "Chase Bank", "currency": "USD", "balance": 25000, "available_balance": 24500, "overdraft_limit": 5000, "routing_number": "021000021", "iban": "GB33BUKB20201555555555", "bic": "CHASUS33", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "country": "US", "status": "active", "description": "Primary operating account for daily transactions", "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}]} + responses: + "200": + application/json: {"status_code": 200, "status": "OK", "service": "quickbooks", "resource": "bank-accounts", "operation": "update", "data": {"id": "12345"}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror"} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.bankAccountsDelete: + speakeasy-default-accounting-bank-accounts-delete: + parameters: + path: + id: "" + query: + raw: false + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + responses: + "200": + application/json: {"status_code": 200, "status": "OK", "service": "quickbooks", "resource": "bank-accounts", "operation": "delete", "data": {"id": "12345"}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror"} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} examplesVersion: 1.0.2 generatedTests: accounting.taxRatesAll: "2025-04-22T11:14:40+01:00" @@ -19986,4 +20189,9 @@ generatedTests: accounting.quotesDelete: "2025-08-06T08:21:29Z" vault.connectionConsentsAll: "2025-09-08T00:03:45Z" vault.connectionConsentUpdate: "2025-09-08T00:03:45Z" -releaseNotes: "## Typescript SDK Changes Detected:\n* `apideck.vault.connectionConsents.list()`: **Added**\n* `apideck.vault.connectionConsent.update()`: **Added**\n* `apideck.accounting.companyInfo.get()`: `response.data.trackingCategoriesMode` **Added**\n* `apideck.accounting.journalEntries.list()`: \n * `request.filter` **Changed**\n* `apideck.accounting.trackingCategories.list()`: `response.data.[].parentName` **Added**\n* `apideck.accounting.trackingCategories.create()`: \n * `request.trackingCategory.parentName` **Added**\n* `apideck.accounting.trackingCategories.get()`: `response.data.parentName` **Added**\n* `apideck.accounting.trackingCategories.update()`: \n * `request.trackingCategory.parentName` **Added**\n* `apideck.accounting.expenses.list()`: \n * `request.filter` **Added**\n * `response.data.[].status` **Added**\n* `apideck.accounting.expenses.create()`: \n * `request.expense.status` **Added**\n* `apideck.accounting.expenses.get()`: `response.data.status` **Added**\n* `apideck.accounting.expenses.update()`: \n * `request.expense.status` **Added**\n* `apideck.vault.connections.list()`: `response.data.[]` **Changed**\n* `apideck.vault.connections.get()`: `response.data` **Changed**\n* `apideck.vault.connections.update()`: \n * `request.connection` **Changed**\n * `response.data` **Changed**\n* `apideck.vault.connections.imports()`: `response.data` **Changed**\n* `apideck.vault.connections.token()`: `response.data` **Changed**\n* `apideck.vault.connectionSettings.list()`: `response.data` **Changed**\n* `apideck.vault.connectionSettings.update()`: \n * `request.connection` **Changed**\n * `response.data` **Changed**\n" + accounting.bankAccountsAll: "2025-09-19T08:08:39Z" + accounting.bankAccountsAdd: "2025-09-19T08:08:39Z" + accounting.bankAccountsOne: "2025-09-19T08:08:39Z" + accounting.bankAccountsUpdate: "2025-09-19T08:08:39Z" + accounting.bankAccountsDelete: "2025-09-19T08:08:39Z" +releaseNotes: "## Typescript SDK Changes Detected:\n* `apideck.accounting.bankAccounts.list()`: **Added**\n* `apideck.accounting.bankAccounts.create()`: **Added**\n* `apideck.accounting.bankAccounts.get()`: **Added**\n* `apideck.accounting.bankAccounts.update()`: **Added**\n* `apideck.accounting.bankAccounts.delete()`: **Added**\n* `apideck.vault.logs.list()`: \n * `request.filter` **Changed**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 130cf9c0..8ed42f2f 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -19,12 +19,13 @@ generation: auth: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: true + hoistGlobalSecurity: true tests: generateTests: true generateNewTests: true skipResponseBodyAssertions: false typescript: - version: 0.29.8 + version: 0.29.9 additionalDependencies: dependencies: {} devDependencies: {} @@ -59,6 +60,7 @@ typescript: outputModelSuffix: output packageName: '@apideck/unify' responseFormat: envelope-http + sseFlatResponse: false templateVersion: v2 usageSDKInitImports: [] useIndexModules: true diff --git a/.speakeasy/tests.arazzo.yaml b/.speakeasy/tests.arazzo.yaml index 0bcebe8c..7bdeed13 100644 --- a/.speakeasy/tests.arazzo.yaml +++ b/.speakeasy/tests.arazzo.yaml @@ -51646,3 +51646,337 @@ workflows: type: simple x-speakeasy-test-group: connectionConsent x-speakeasy-test-rebuild: true + - workflowId: accounting.bankAccountsAll + steps: + - stepId: test + operationId: accounting.bankAccountsAll + parameters: + - name: raw + in: query + value: false + - name: limit + in: query + value: 20 + - name: filter + in: query + value: + name: Main Operating + status: active + - name: sort + in: query + value: + by: updated_at + direction: asc + - name: pass_through + in: query + value: + search: San Francisco + - name: fields + in: query + value: id,updated_at + - name: x-apideck-consumer-id + in: header + value: test-consumer + - name: x-apideck-app-id + in: header + value: dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX + - name: x-apideck-service-id + in: header + value: salesforce + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + { + "status_code": 200, + "status": "OK", + "service": "quickbooks", + "resource": "bank-accounts", + "operation": "all", + "data": [ + { + "id": "12345", + "display_id": "BA-001", + "name": "Main Operating Account", + "account_number": "1234567890", + "account_type": "checking", + "bank_name": "Chase Bank", + "currency": "USD", + "balance": 25000, + "available_balance": 24500, + "overdraft_limit": 5000, + "routing_number": "021000021", + "iban": "GB33BUKB20201555555555", + "bic": "CHASUS33", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", + "country": "US", + "status": "active", + "description": "Primary operating account for daily transactions", + "custom_fields": [ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": "Uses Salesforce and Marketo" + } + ], + "created_at": "2020-09-30T07:43:32.000Z", + "updated_at": "2020-09-30T07:43:32.000Z", + "created_by": "12345", + "updated_by": "12345" + } + ], + "meta": { + "items_on_page": 50, + "cursors": { + "previous": "em9oby1jcm06OnBhZ2U6OjE=", + "current": "em9oby1jcm06OnBhZ2U6OjI=", + "next": "em9oby1jcm06OnBhZ2U6OjM=" + } + }, + "links": { + "previous": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D", + "current": "https://unify.apideck.com/crm/companies", + "next": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM" + } + } + type: simple + x-speakeasy-test-group: bankAccounts + x-speakeasy-test-rebuild: true + - workflowId: accounting.bankAccountsAdd + steps: + - stepId: test + operationId: accounting.bankAccountsAdd + parameters: + - name: raw + in: query + value: false + - name: x-apideck-consumer-id + in: header + value: test-consumer + - name: x-apideck-app-id + in: header + value: dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX + - name: x-apideck-service-id + in: header + value: salesforce + requestBody: + contentType: application/json + payload: + account_number: "1234567890" + account_type: checking + available_balance: 24500 + balance: 25000 + bank_code: BNH + bank_name: Chase Bank + bic: CHASUS33 + branch_identifier: "001" + bsb_number: 062-001 + country: US + currency: USD + custom_fields: + - description: Employee Level + id: "2389328923893298" + name: employee_level + value: Uses Salesforce and Marketo + description: Primary operating account for daily transactions + display_id: BA-001 + iban: GB33BUKB20201555555555 + name: Main Operating Account + overdraft_limit: 5000 + routing_number: "021000021" + status: active + successCriteria: + - condition: $statusCode == 201 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + { + "status_code": 201, + "status": "Created", + "service": "quickbooks", + "resource": "bank-accounts", + "operation": "add", + "data": { + "id": "12345" + } + } + type: simple + x-speakeasy-test-group: bankAccounts + x-speakeasy-test-rebuild: true + - workflowId: accounting.bankAccountsOne + steps: + - stepId: test + operationId: accounting.bankAccountsOne + parameters: + - name: id + in: path + value: + - name: raw + in: query + value: false + - name: fields + in: query + value: id,updated_at + - name: x-apideck-consumer-id + in: header + value: test-consumer + - name: x-apideck-app-id + in: header + value: dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX + - name: x-apideck-service-id + in: header + value: salesforce + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + { + "status_code": 200, + "status": "OK", + "service": "quickbooks", + "resource": "bank-accounts", + "operation": "one", + "data": { + "id": "12345", + "display_id": "BA-001", + "name": "Main Operating Account", + "account_number": "1234567890", + "account_type": "checking", + "bank_name": "Chase Bank", + "currency": "USD", + "balance": 25000, + "available_balance": 24500, + "overdraft_limit": 5000, + "routing_number": "021000021", + "iban": "GB33BUKB20201555555555", + "bic": "CHASUS33", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", + "country": "US", + "status": "active", + "description": "Primary operating account for daily transactions", + "custom_fields": [ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": "Uses Salesforce and Marketo" + } + ], + "created_at": "2020-09-30T07:43:32.000Z", + "updated_at": "2020-09-30T07:43:32.000Z", + "created_by": "12345", + "updated_by": "12345" + } + } + type: simple + x-speakeasy-test-group: bankAccounts + x-speakeasy-test-rebuild: true + - workflowId: accounting.bankAccountsUpdate + steps: + - stepId: test + operationId: accounting.bankAccountsUpdate + parameters: + - name: id + in: path + value: + - name: raw + in: query + value: false + - name: x-apideck-consumer-id + in: header + value: test-consumer + - name: x-apideck-app-id + in: header + value: dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX + - name: x-apideck-service-id + in: header + value: salesforce + requestBody: + contentType: application/json + payload: + account_number: "1234567890" + account_type: checking + available_balance: 24500 + balance: 25000 + bank_code: BNH + bank_name: Chase Bank + bic: CHASUS33 + branch_identifier: "001" + bsb_number: 062-001 + country: US + currency: USD + custom_fields: + - description: Employee Level + id: "2389328923893298" + name: employee_level + value: Uses Salesforce and Marketo + description: Primary operating account for daily transactions + display_id: BA-001 + iban: GB33BUKB20201555555555 + name: Main Operating Account + overdraft_limit: 5000 + routing_number: "021000021" + status: active + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + { + "status_code": 200, + "status": "OK", + "service": "quickbooks", + "resource": "bank-accounts", + "operation": "update", + "data": { + "id": "12345" + } + } + type: simple + x-speakeasy-test-group: bankAccounts + x-speakeasy-test-rebuild: true + - workflowId: accounting.bankAccountsDelete + steps: + - stepId: test + operationId: accounting.bankAccountsDelete + parameters: + - name: id + in: path + value: + - name: raw + in: query + value: false + - name: x-apideck-consumer-id + in: header + value: test-consumer + - name: x-apideck-app-id + in: header + value: dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX + - name: x-apideck-service-id + in: header + value: salesforce + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + { + "status_code": 200, + "status": "OK", + "service": "quickbooks", + "resource": "bank-accounts", + "operation": "delete", + "data": { + "id": "12345" + } + } + type: simple + x-speakeasy-test-group: bankAccounts + x-speakeasy-test-rebuild: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 1c4dc8cd..9ca23aef 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.611.1 +speakeasyVersion: 1.621.0 sources: Apideck-OAS: sourceNamespace: apideck-oas - sourceRevisionDigest: sha256:cb0201d032f54350a28bd8c493037ef74777e49604a1b8f76718c2d0d9918db4 - sourceBlobDigest: sha256:88de9a39fea7106d70b4526a9c8207a4c54c38a3c13136b2b27fbb947336e267 + sourceRevisionDigest: sha256:a6bcd5ccb7c969b42e8ad8b17f9f9fada68d5dcb1df1fc9f740c093e6f7a59fb + sourceBlobDigest: sha256:6f9d2a5ef2ad35a10bb779aefcb98d75609448f4b14ea7f9268f7ad166c206a3 tags: - latest - - speakeasy-sdk-regen-1756211937 - - 10.20.13 + - speakeasy-sdk-regen-1757940184 + - 10.20.16 targets: apideck: source: Apideck-OAS sourceNamespace: apideck-oas - sourceRevisionDigest: sha256:cb0201d032f54350a28bd8c493037ef74777e49604a1b8f76718c2d0d9918db4 - sourceBlobDigest: sha256:88de9a39fea7106d70b4526a9c8207a4c54c38a3c13136b2b27fbb947336e267 + sourceRevisionDigest: sha256:a6bcd5ccb7c969b42e8ad8b17f9f9fada68d5dcb1df1fc9f740c093e6f7a59fb + sourceBlobDigest: sha256:6f9d2a5ef2ad35a10bb779aefcb98d75609448f4b14ea7f9268f7ad166c206a3 codeSamplesNamespace: apideck-oas-typescript-code-samples - codeSamplesRevisionDigest: sha256:6dc8ae18d73a3394d47076e22d262a03b511c96fbaa45e77b702cfb80b3e0db8 + codeSamplesRevisionDigest: sha256:04adccacc72f445a1452e35f4f4f8908c8c9cdf9de66499f4957a97063b6b2aa workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 7eb19c03..8668a874 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,14 @@ run(); * [get](docs/sdks/balancesheet/README.md#get) - Get BalanceSheet +#### [accounting.bankAccounts](docs/sdks/bankaccounts/README.md) + +* [list](docs/sdks/bankaccounts/README.md#list) - List Bank Accounts +* [create](docs/sdks/bankaccounts/README.md#create) - Create Bank Account +* [get](docs/sdks/bankaccounts/README.md#get) - Get Bank Account +* [update](docs/sdks/bankaccounts/README.md#update) - Update Bank Account +* [delete](docs/sdks/bankaccounts/README.md#delete) - Delete Bank Account + #### [accounting.bankFeedAccounts](docs/sdks/bankfeedaccounts/README.md) * [list](docs/sdks/bankfeedaccounts/README.md#list) - List Bank Feed Accounts @@ -733,6 +741,11 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [`accountingAttachmentsList`](docs/sdks/attachments/README.md#list) - List Attachments - [`accountingAttachmentsUpload`](docs/sdks/attachments/README.md#upload) - Upload attachment - [`accountingBalanceSheetGet`](docs/sdks/balancesheet/README.md#get) - Get BalanceSheet +- [`accountingBankAccountsCreate`](docs/sdks/bankaccounts/README.md#create) - Create Bank Account +- [`accountingBankAccountsDelete`](docs/sdks/bankaccounts/README.md#delete) - Delete Bank Account +- [`accountingBankAccountsGet`](docs/sdks/bankaccounts/README.md#get) - Get Bank Account +- [`accountingBankAccountsList`](docs/sdks/bankaccounts/README.md#list) - List Bank Accounts +- [`accountingBankAccountsUpdate`](docs/sdks/bankaccounts/README.md#update) - Update Bank Account - [`accountingBankFeedAccountsCreate`](docs/sdks/bankfeedaccounts/README.md#create) - Create Bank Feed Account - [`accountingBankFeedAccountsDelete`](docs/sdks/bankfeedaccounts/README.md#delete) - Delete Bank Feed Account - [`accountingBankFeedAccountsGet`](docs/sdks/bankfeedaccounts/README.md#get) - Get Bank Feed Account diff --git a/RELEASES.md b/RELEASES.md index d9afd322..78c03641 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -488,4 +488,14 @@ Based on: ### Generated - [typescript v0.29.8] . ### Releases -- [NPM v0.29.8] https://www.npmjs.com/package/@apideck/unify/v/0.29.8 - . \ No newline at end of file +- [NPM v0.29.8] https://www.npmjs.com/package/@apideck/unify/v/0.29.8 - . + +## 2025-09-19 08:07:41 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.621.0 (2.707.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.29.9] . +### Releases +- [NPM v0.29.9] https://www.npmjs.com/package/@apideck/unify/v/0.29.9 - . \ No newline at end of file diff --git a/docs/models/components/accountingbankaccount.md b/docs/models/components/accountingbankaccount.md new file mode 100644 index 00000000..9cc643ee --- /dev/null +++ b/docs/models/components/accountingbankaccount.md @@ -0,0 +1,71 @@ +# AccountingBankAccount + +## Example Usage + +```typescript +import { AccountingBankAccount } from "@apideck/unify/models/components"; + +let value: AccountingBankAccount = { + id: "12345", + displayId: "BA-001", + name: "Main Operating Account", + accountNumber: "1234567890", + accountType: "checking", + bankName: "Chase Bank", + currency: "USD", + balance: 25000, + availableBalance: 24500, + overdraftLimit: 5000, + routingNumber: "021000021", + iban: "GB33BUKB20201555555555", + bic: "CHASUS33", + bsbNumber: "062-001", + branchIdentifier: "001", + bankCode: "BNH", + country: "US", + status: "active", + description: "Primary operating account for daily transactions", + customFields: [ + { + id: "2389328923893298", + name: "employee_level", + description: "Employee Level", + value: "Uses Salesforce and Marketo", + }, + ], + createdAt: new Date("2020-09-30T07:43:32.000Z"), + updatedAt: new Date("2020-09-30T07:43:32.000Z"), + createdBy: "12345", + updatedBy: "12345", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | A unique identifier for an object. | 12345 | +| `displayId` | *string* | :heavy_minus_sign: | Display ID for the bank account | BA-001 | +| `name` | *string* | :heavy_minus_sign: | The name of the bank account as it appears in the accounting system | Main Operating Account | +| `accountNumber` | *string* | :heavy_minus_sign: | The bank account number | 1234567890 | +| `accountType` | [components.AccountingBankAccountAccountType](../../models/components/accountingbankaccountaccounttype.md) | :heavy_minus_sign: | The type of bank account | checking | +| `bankName` | *string* | :heavy_minus_sign: | The name of the bank or financial institution | Chase Bank | +| `currency` | [components.Currency](../../models/components/currency.md) | :heavy_minus_sign: | Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). | USD | +| `balance` | *number* | :heavy_minus_sign: | The current balance of the bank account | 25000 | +| `availableBalance` | *number* | :heavy_minus_sign: | The available balance (considering pending transactions and overdraft) | 24500 | +| `overdraftLimit` | *number* | :heavy_minus_sign: | The overdraft limit for the account | 5000 | +| `routingNumber` | *string* | :heavy_minus_sign: | Bank routing number (US) | 021000021 | +| `iban` | *string* | :heavy_minus_sign: | International Bank Account Number | GB33BUKB20201555555555 | +| `bic` | *string* | :heavy_minus_sign: | Bank Identifier Code / SWIFT Code | CHASUS33 | +| `bsbNumber` | *string* | :heavy_minus_sign: | Bank State Branch number (Australia/New Zealand) | 062-001 | +| `branchIdentifier` | *string* | :heavy_minus_sign: | Bank branch identifier | 001 | +| `bankCode` | *string* | :heavy_minus_sign: | Bank code assigned by central bank | BNH | +| `country` | *string* | :heavy_minus_sign: | Country code according to ISO 3166-1 alpha-2. | US | +| `status` | [components.AccountingBankAccountStatus](../../models/components/accountingbankaccountstatus.md) | :heavy_minus_sign: | The status of the bank account | active | +| `description` | *string* | :heavy_minus_sign: | Description or notes about the bank account | Primary operating account for daily transactions | +| `customFields` | [components.CustomField](../../models/components/customfield.md)[] | :heavy_minus_sign: | N/A | | +| `customMappings` | Record | :heavy_minus_sign: | When custom mappings are configured on the resource, the result is included here. | | +| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The date and time when the object was created. | 2020-09-30T07:43:32.000Z | +| `updatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The date and time when the object was last updated. | 2020-09-30T07:43:32.000Z | +| `createdBy` | *string* | :heavy_minus_sign: | The user who created the object. | 12345 | +| `updatedBy` | *string* | :heavy_minus_sign: | The user who last updated the object. | 12345 | \ No newline at end of file diff --git a/docs/models/components/accountingbankaccountaccounttype.md b/docs/models/components/accountingbankaccountaccounttype.md new file mode 100644 index 00000000..318a2d98 --- /dev/null +++ b/docs/models/components/accountingbankaccountaccounttype.md @@ -0,0 +1,17 @@ +# AccountingBankAccountAccountType + +The type of bank account + +## Example Usage + +```typescript +import { AccountingBankAccountAccountType } from "@apideck/unify/models/components"; + +let value: AccountingBankAccountAccountType = "checking"; +``` + +## Values + +```typescript +"checking" | "savings" | "credit_card" | "money_market" | "line_of_credit" | "other" +``` \ No newline at end of file diff --git a/docs/models/components/accountingbankaccountinput.md b/docs/models/components/accountingbankaccountinput.md new file mode 100644 index 00000000..1bb42800 --- /dev/null +++ b/docs/models/components/accountingbankaccountinput.md @@ -0,0 +1,60 @@ +# AccountingBankAccountInput + +## Example Usage + +```typescript +import { AccountingBankAccountInput } from "@apideck/unify/models/components"; + +let value: AccountingBankAccountInput = { + displayId: "BA-001", + name: "Main Operating Account", + accountNumber: "1234567890", + accountType: "checking", + bankName: "Chase Bank", + currency: "USD", + balance: 25000, + availableBalance: 24500, + overdraftLimit: 5000, + routingNumber: "021000021", + iban: "GB33BUKB20201555555555", + bic: "CHASUS33", + bsbNumber: "062-001", + branchIdentifier: "001", + bankCode: "BNH", + country: "US", + status: "active", + description: "Primary operating account for daily transactions", + customFields: [ + { + id: "2389328923893298", + name: "employee_level", + description: "Employee Level", + value: "Uses Salesforce and Marketo", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `displayId` | *string* | :heavy_minus_sign: | Display ID for the bank account | BA-001 | +| `name` | *string* | :heavy_minus_sign: | The name of the bank account as it appears in the accounting system | Main Operating Account | +| `accountNumber` | *string* | :heavy_minus_sign: | The bank account number | 1234567890 | +| `accountType` | [components.AccountingBankAccountAccountType](../../models/components/accountingbankaccountaccounttype.md) | :heavy_minus_sign: | The type of bank account | checking | +| `bankName` | *string* | :heavy_minus_sign: | The name of the bank or financial institution | Chase Bank | +| `currency` | [components.Currency](../../models/components/currency.md) | :heavy_minus_sign: | Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). | USD | +| `balance` | *number* | :heavy_minus_sign: | The current balance of the bank account | 25000 | +| `availableBalance` | *number* | :heavy_minus_sign: | The available balance (considering pending transactions and overdraft) | 24500 | +| `overdraftLimit` | *number* | :heavy_minus_sign: | The overdraft limit for the account | 5000 | +| `routingNumber` | *string* | :heavy_minus_sign: | Bank routing number (US) | 021000021 | +| `iban` | *string* | :heavy_minus_sign: | International Bank Account Number | GB33BUKB20201555555555 | +| `bic` | *string* | :heavy_minus_sign: | Bank Identifier Code / SWIFT Code | CHASUS33 | +| `bsbNumber` | *string* | :heavy_minus_sign: | Bank State Branch number (Australia/New Zealand) | 062-001 | +| `branchIdentifier` | *string* | :heavy_minus_sign: | Bank branch identifier | 001 | +| `bankCode` | *string* | :heavy_minus_sign: | Bank code assigned by central bank | BNH | +| `country` | *string* | :heavy_minus_sign: | Country code according to ISO 3166-1 alpha-2. | US | +| `status` | [components.AccountingBankAccountStatus](../../models/components/accountingbankaccountstatus.md) | :heavy_minus_sign: | The status of the bank account | active | +| `description` | *string* | :heavy_minus_sign: | Description or notes about the bank account | Primary operating account for daily transactions | +| `customFields` | [components.CustomField](../../models/components/customfield.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/accountingbankaccountstatus.md b/docs/models/components/accountingbankaccountstatus.md new file mode 100644 index 00000000..6902658f --- /dev/null +++ b/docs/models/components/accountingbankaccountstatus.md @@ -0,0 +1,17 @@ +# AccountingBankAccountStatus + +The status of the bank account + +## Example Usage + +```typescript +import { AccountingBankAccountStatus } from "@apideck/unify/models/components"; + +let value: AccountingBankAccountStatus = "active"; +``` + +## Values + +```typescript +"active" | "inactive" | "closed" +``` \ No newline at end of file diff --git a/docs/models/components/bankaccountsfilter.md b/docs/models/components/bankaccountsfilter.md new file mode 100644 index 00000000..0c916743 --- /dev/null +++ b/docs/models/components/bankaccountsfilter.md @@ -0,0 +1,19 @@ +# BankAccountsFilter + +## Example Usage + +```typescript +import { BankAccountsFilter } from "@apideck/unify/models/components"; + +let value: BankAccountsFilter = { + name: "Main Operating", + status: "active", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `name` | *string* | :heavy_minus_sign: | Filter by bank account name | Main Operating | +| `status` | [components.BankAccountsFilterStatus](../../models/components/bankaccountsfilterstatus.md) | :heavy_minus_sign: | Filter by account status | active | \ No newline at end of file diff --git a/docs/models/components/bankaccountsfilterstatus.md b/docs/models/components/bankaccountsfilterstatus.md new file mode 100644 index 00000000..584732b7 --- /dev/null +++ b/docs/models/components/bankaccountsfilterstatus.md @@ -0,0 +1,17 @@ +# BankAccountsFilterStatus + +Filter by account status + +## Example Usage + +```typescript +import { BankAccountsFilterStatus } from "@apideck/unify/models/components"; + +let value: BankAccountsFilterStatus = "active"; +``` + +## Values + +```typescript +"active" | "inactive" | "closed" +``` \ No newline at end of file diff --git a/docs/models/components/bankaccountssort.md b/docs/models/components/bankaccountssort.md new file mode 100644 index 00000000..ad9f50e4 --- /dev/null +++ b/docs/models/components/bankaccountssort.md @@ -0,0 +1,16 @@ +# BankAccountsSort + +## Example Usage + +```typescript +import { BankAccountsSort } from "@apideck/unify/models/components"; + +let value: BankAccountsSort = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `by` | [components.SortBy](../../models/components/sortby.md) | :heavy_minus_sign: | The field to sort by | updated_at | +| `direction` | [components.SortDirection](../../models/components/sortdirection.md) | :heavy_minus_sign: | The direction in which to sort the results | | \ No newline at end of file diff --git a/docs/models/components/configuration.md b/docs/models/components/configuration.md index dfbed027..b64c92de 100644 --- a/docs/models/components/configuration.md +++ b/docs/models/components/configuration.md @@ -14,14 +14,7 @@ let value: Configuration = { options: [ { label: "General Channel", - options: [ - { - label: "General Channel", - value: "general", - optionType: "simple", - }, - ], - optionType: "group", + optionType: "simple", }, ], value: "GC5000 series", diff --git a/docs/models/components/connection.md b/docs/models/components/connection.md index 6d538a55..7c2bf71e 100644 --- a/docs/models/components/connection.md +++ b/docs/models/components/connection.md @@ -69,14 +69,7 @@ let value: Connection = { options: [ { label: "General Channel", - options: [ - { - label: "General Channel", - value: "general", - optionType: "simple", - }, - ], - optionType: "group", + optionType: "simple", }, ], value: "GC5000 series", diff --git a/docs/models/components/connectionconfiguration.md b/docs/models/components/connectionconfiguration.md index 2d4692cd..2b0432e6 100644 --- a/docs/models/components/connectionconfiguration.md +++ b/docs/models/components/connectionconfiguration.md @@ -13,7 +13,14 @@ let value: ConnectionConfiguration = { options: [ { label: "General Channel", - optionType: "simple", + options: [ + { + label: "General Channel", + value: "general", + optionType: "simple", + }, + ], + optionType: "group", }, ], value: "GC5000 series", diff --git a/docs/models/components/connectioninput.md b/docs/models/components/connectioninput.md index fae37527..65b39e16 100644 --- a/docs/models/components/connectioninput.md +++ b/docs/models/components/connectioninput.md @@ -27,7 +27,14 @@ let value: ConnectionInput = { options: [ { label: "General Channel", - optionType: "simple", + options: [ + { + label: "General Channel", + value: "general", + optionType: "simple", + }, + ], + optionType: "group", }, ], value: "GC5000 series", diff --git a/docs/models/components/createbankaccountresponse.md b/docs/models/components/createbankaccountresponse.md new file mode 100644 index 00000000..f719b456 --- /dev/null +++ b/docs/models/components/createbankaccountresponse.md @@ -0,0 +1,31 @@ +# CreateBankAccountResponse + +Bank Account created + +## Example Usage + +```typescript +import { CreateBankAccountResponse } from "@apideck/unify/models/components"; + +let value: CreateBankAccountResponse = { + statusCode: 201, + status: "Created", + service: "quickbooks", + resource: "bank-accounts", + operation: "add", + data: { + id: "12345", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `statusCode` | *number* | :heavy_check_mark: | HTTP Response Status Code | 201 | +| `status` | *string* | :heavy_check_mark: | HTTP Response Status | Created | +| `service` | *string* | :heavy_minus_sign: | Apideck ID of service provider | quickbooks | +| `resource` | *string* | :heavy_minus_sign: | Unified API resource name | bank-accounts | +| `operation` | *string* | :heavy_minus_sign: | Operation performed | add | +| `data` | [components.UnifiedId](../../models/components/unifiedid.md) | :heavy_check_mark: | A object containing a unique identifier for the resource that was created, updated, or deleted. | | \ No newline at end of file diff --git a/docs/models/components/createconnectionresponse.md b/docs/models/components/createconnectionresponse.md index 53fcf801..96e9deac 100644 --- a/docs/models/components/createconnectionresponse.md +++ b/docs/models/components/createconnectionresponse.md @@ -74,14 +74,7 @@ let value: CreateConnectionResponse = { options: [ { label: "General Channel", - options: [ - { - label: "General Channel", - value: "general", - optionType: "simple", - }, - ], - optionType: "group", + optionType: "simple", }, ], value: "GC5000 series", diff --git a/docs/models/components/defaults.md b/docs/models/components/defaults.md index ecf797ac..0524df90 100644 --- a/docs/models/components/defaults.md +++ b/docs/models/components/defaults.md @@ -11,14 +11,7 @@ let value: Defaults = { options: [ { label: "General Channel", - options: [ - { - label: "General Channel", - value: "general", - optionType: "simple", - }, - ], - optionType: "group", + optionType: "simple", }, ], value: "GC5000 series", diff --git a/docs/models/components/deletebankaccountresponse.md b/docs/models/components/deletebankaccountresponse.md new file mode 100644 index 00000000..fdf18ed5 --- /dev/null +++ b/docs/models/components/deletebankaccountresponse.md @@ -0,0 +1,31 @@ +# DeleteBankAccountResponse + +Bank Account deleted + +## Example Usage + +```typescript +import { DeleteBankAccountResponse } from "@apideck/unify/models/components"; + +let value: DeleteBankAccountResponse = { + statusCode: 200, + status: "OK", + service: "quickbooks", + resource: "bank-accounts", + operation: "delete", + data: { + id: "12345", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `statusCode` | *number* | :heavy_check_mark: | HTTP Response Status Code | 200 | +| `status` | *string* | :heavy_check_mark: | HTTP Response Status | OK | +| `service` | *string* | :heavy_minus_sign: | Apideck ID of service provider | quickbooks | +| `resource` | *string* | :heavy_minus_sign: | Unified API resource name | bank-accounts | +| `operation` | *string* | :heavy_minus_sign: | Operation performed | delete | +| `data` | [components.UnifiedId](../../models/components/unifiedid.md) | :heavy_check_mark: | A object containing a unique identifier for the resource that was created, updated, or deleted. | | \ No newline at end of file diff --git a/docs/models/components/getbankaccountresponse.md b/docs/models/components/getbankaccountresponse.md new file mode 100644 index 00000000..65eed004 --- /dev/null +++ b/docs/models/components/getbankaccountresponse.md @@ -0,0 +1,61 @@ +# GetBankAccountResponse + +Bank Account + +## Example Usage + +```typescript +import { GetBankAccountResponse } from "@apideck/unify/models/components"; + +let value: GetBankAccountResponse = { + statusCode: 200, + status: "OK", + service: "quickbooks", + resource: "bank-accounts", + operation: "one", + data: { + id: "12345", + displayId: "BA-001", + name: "Main Operating Account", + accountNumber: "1234567890", + accountType: "checking", + bankName: "Chase Bank", + currency: "USD", + balance: 25000, + availableBalance: 24500, + overdraftLimit: 5000, + routingNumber: "021000021", + iban: "GB33BUKB20201555555555", + bic: "CHASUS33", + bsbNumber: "062-001", + branchIdentifier: "001", + bankCode: "BNH", + country: "US", + status: "active", + description: "Primary operating account for daily transactions", + customFields: [ + { + id: "2389328923893298", + name: "employee_level", + description: "Employee Level", + value: "Uses Salesforce and Marketo", + }, + ], + createdAt: new Date("2020-09-30T07:43:32.000Z"), + updatedAt: new Date("2020-09-30T07:43:32.000Z"), + createdBy: "12345", + updatedBy: "12345", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `statusCode` | *number* | :heavy_check_mark: | HTTP Response Status Code | 200 | +| `status` | *string* | :heavy_check_mark: | HTTP Response Status | OK | +| `service` | *string* | :heavy_minus_sign: | Apideck ID of service provider | quickbooks | +| `resource` | *string* | :heavy_minus_sign: | Unified API resource name | bank-accounts | +| `operation` | *string* | :heavy_minus_sign: | Operation performed | one | +| `data` | [components.AccountingBankAccount](../../models/components/accountingbankaccount.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/getbankaccountsresponse.md b/docs/models/components/getbankaccountsresponse.md new file mode 100644 index 00000000..9a8a5856 --- /dev/null +++ b/docs/models/components/getbankaccountsresponse.md @@ -0,0 +1,46 @@ +# GetBankAccountsResponse + +Bank Accounts + +## Example Usage + +```typescript +import { GetBankAccountsResponse } from "@apideck/unify/models/components"; + +let value: GetBankAccountsResponse = { + statusCode: 200, + status: "OK", + service: "quickbooks", + resource: "bank-accounts", + operation: "all", + data: [], + meta: { + itemsOnPage: 50, + cursors: { + previous: "em9oby1jcm06OnBhZ2U6OjE=", + current: "em9oby1jcm06OnBhZ2U6OjI=", + next: "em9oby1jcm06OnBhZ2U6OjM=", + }, + }, + links: { + previous: + "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D", + current: "https://unify.apideck.com/crm/companies", + next: + "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `statusCode` | *number* | :heavy_check_mark: | HTTP Response Status Code | 200 | +| `status` | *string* | :heavy_check_mark: | HTTP Response Status | OK | +| `service` | *string* | :heavy_minus_sign: | Apideck ID of service provider | quickbooks | +| `resource` | *string* | :heavy_minus_sign: | Unified API resource name | bank-accounts | +| `operation` | *string* | :heavy_minus_sign: | Operation performed | all | +| `data` | [components.AccountingBankAccount](../../models/components/accountingbankaccount.md)[] | :heavy_check_mark: | N/A | | +| `meta` | [components.Meta](../../models/components/meta.md) | :heavy_minus_sign: | Response metadata | | +| `links` | [components.Links](../../models/components/links.md) | :heavy_minus_sign: | Links to navigate to previous or next pages through the API | | \ No newline at end of file diff --git a/docs/models/components/getconnectionresponse.md b/docs/models/components/getconnectionresponse.md index dea9a27f..90d1558b 100644 --- a/docs/models/components/getconnectionresponse.md +++ b/docs/models/components/getconnectionresponse.md @@ -74,14 +74,7 @@ let value: GetConnectionResponse = { options: [ { label: "General Channel", - options: [ - { - label: "General Channel", - value: "general", - optionType: "simple", - }, - ], - optionType: "group", + optionType: "simple", }, ], value: "GC5000 series", diff --git a/docs/models/components/logsfilter.md b/docs/models/components/logsfilter.md index 3887afe2..1f83d095 100644 --- a/docs/models/components/logsfilter.md +++ b/docs/models/components/logsfilter.md @@ -8,14 +8,20 @@ import { LogsFilter } from "@apideck/unify/models/components"; let value: LogsFilter = { connectorId: "crm+salesforce", statusCode: 201, + statusCodes: [ + 200, + 201, + 204, + ], excludeUnifiedApis: "vault,proxy", }; ``` ## Fields -| Field | Type | Required | Description | Example | -| -------------------- | -------------------- | -------------------- | -------------------- | -------------------- | -| `connectorId` | *string* | :heavy_minus_sign: | N/A | crm+salesforce | -| `statusCode` | *number* | :heavy_minus_sign: | N/A | 201 | -| `excludeUnifiedApis` | *string* | :heavy_minus_sign: | N/A | vault,proxy | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `connectorId` | *string* | :heavy_minus_sign: | N/A | crm+salesforce | +| `statusCode` | *number* | :heavy_minus_sign: | Filter by a single HTTP status code. For backward compatibility - use status_codes for multiple values. | 201 | +| `statusCodes` | *number*[] | :heavy_minus_sign: | Filter by multiple HTTP status codes. Values must be between 100-599. Maximum 50 status codes allowed. | [
200,
201,
204
] | +| `excludeUnifiedApis` | *string* | :heavy_minus_sign: | N/A | vault,proxy | \ No newline at end of file diff --git a/docs/models/components/sortby.md b/docs/models/components/sortby.md new file mode 100644 index 00000000..418b75db --- /dev/null +++ b/docs/models/components/sortby.md @@ -0,0 +1,17 @@ +# SortBy + +The field to sort by + +## Example Usage + +```typescript +import { SortBy } from "@apideck/unify/models/components"; + +let value: SortBy = "updated_at"; +``` + +## Values + +```typescript +"created_at" | "updated_at" +``` \ No newline at end of file diff --git a/docs/models/components/updatebankaccountresponse.md b/docs/models/components/updatebankaccountresponse.md new file mode 100644 index 00000000..7d800a99 --- /dev/null +++ b/docs/models/components/updatebankaccountresponse.md @@ -0,0 +1,31 @@ +# UpdateBankAccountResponse + +Bank Account updated + +## Example Usage + +```typescript +import { UpdateBankAccountResponse } from "@apideck/unify/models/components"; + +let value: UpdateBankAccountResponse = { + statusCode: 200, + status: "OK", + service: "quickbooks", + resource: "bank-accounts", + operation: "update", + data: { + id: "12345", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `statusCode` | *number* | :heavy_check_mark: | HTTP Response Status Code | 200 | +| `status` | *string* | :heavy_check_mark: | HTTP Response Status | OK | +| `service` | *string* | :heavy_minus_sign: | Apideck ID of service provider | quickbooks | +| `resource` | *string* | :heavy_minus_sign: | Unified API resource name | bank-accounts | +| `operation` | *string* | :heavy_minus_sign: | Operation performed | update | +| `data` | [components.UnifiedId](../../models/components/unifiedid.md) | :heavy_check_mark: | A object containing a unique identifier for the resource that was created, updated, or deleted. | | \ No newline at end of file diff --git a/docs/models/components/updateconnectionresponse.md b/docs/models/components/updateconnectionresponse.md index 5ad8726e..88b3387b 100644 --- a/docs/models/components/updateconnectionresponse.md +++ b/docs/models/components/updateconnectionresponse.md @@ -74,14 +74,7 @@ let value: UpdateConnectionResponse = { options: [ { label: "General Channel", - options: [ - { - label: "General Channel", - value: "general", - optionType: "simple", - }, - ], - optionType: "group", + optionType: "simple", }, ], value: "GC5000 series", diff --git a/docs/models/operations/accountingbankaccountsaddglobals.md b/docs/models/operations/accountingbankaccountsaddglobals.md new file mode 100644 index 00000000..5f2ca658 --- /dev/null +++ b/docs/models/operations/accountingbankaccountsaddglobals.md @@ -0,0 +1,19 @@ +# AccountingBankAccountsAddGlobals + +## Example Usage + +```typescript +import { AccountingBankAccountsAddGlobals } from "@apideck/unify/models/operations"; + +let value: AccountingBankAccountsAddGlobals = { + consumerId: "test-consumer", + appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `consumerId` | *string* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *string* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | \ No newline at end of file diff --git a/docs/models/operations/accountingbankaccountsaddrequest.md b/docs/models/operations/accountingbankaccountsaddrequest.md new file mode 100644 index 00000000..dfc1df92 --- /dev/null +++ b/docs/models/operations/accountingbankaccountsaddrequest.md @@ -0,0 +1,49 @@ +# AccountingBankAccountsAddRequest + +## Example Usage + +```typescript +import { AccountingBankAccountsAddRequest } from "@apideck/unify/models/operations"; + +let value: AccountingBankAccountsAddRequest = { + serviceId: "salesforce", + accountingBankAccount: { + displayId: "BA-001", + name: "Main Operating Account", + accountNumber: "1234567890", + accountType: "checking", + bankName: "Chase Bank", + currency: "USD", + balance: 25000, + availableBalance: 24500, + overdraftLimit: 5000, + routingNumber: "021000021", + iban: "GB33BUKB20201555555555", + bic: "CHASUS33", + bsbNumber: "062-001", + branchIdentifier: "001", + bankCode: "BNH", + country: "US", + status: "active", + description: "Primary operating account for daily transactions", + customFields: [ + { + id: "2389328923893298", + name: "employee_level", + description: "Employee Level", + value: "Uses Salesforce and Marketo", + }, + ], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *boolean* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `consumerId` | *string* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *string* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `serviceId` | *string* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `accountingBankAccount` | [components.AccountingBankAccountInput](../../models/components/accountingbankaccountinput.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/accountingbankaccountsaddresponse.md b/docs/models/operations/accountingbankaccountsaddresponse.md new file mode 100644 index 00000000..5592bec7 --- /dev/null +++ b/docs/models/operations/accountingbankaccountsaddresponse.md @@ -0,0 +1,17 @@ +# AccountingBankAccountsAddResponse + +## Example Usage + +```typescript +import { AccountingBankAccountsAddResponse } from "@apideck/unify/models/operations"; + +let value: AccountingBankAccountsAddResponse = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `createBankAccountResponse` | [components.CreateBankAccountResponse](../../models/components/createbankaccountresponse.md) | :heavy_minus_sign: | Bank Account created | +| `unexpectedErrorResponse` | [components.UnexpectedErrorResponse](../../models/components/unexpectederrorresponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/operations/accountingbankaccountsallglobals.md b/docs/models/operations/accountingbankaccountsallglobals.md new file mode 100644 index 00000000..bfc6cad0 --- /dev/null +++ b/docs/models/operations/accountingbankaccountsallglobals.md @@ -0,0 +1,19 @@ +# AccountingBankAccountsAllGlobals + +## Example Usage + +```typescript +import { AccountingBankAccountsAllGlobals } from "@apideck/unify/models/operations"; + +let value: AccountingBankAccountsAllGlobals = { + consumerId: "test-consumer", + appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `consumerId` | *string* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *string* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | \ No newline at end of file diff --git a/docs/models/operations/accountingbankaccountsallrequest.md b/docs/models/operations/accountingbankaccountsallrequest.md new file mode 100644 index 00000000..25d7c12a --- /dev/null +++ b/docs/models/operations/accountingbankaccountsallrequest.md @@ -0,0 +1,35 @@ +# AccountingBankAccountsAllRequest + +## Example Usage + +```typescript +import { AccountingBankAccountsAllRequest } from "@apideck/unify/models/operations"; + +let value: AccountingBankAccountsAllRequest = { + serviceId: "salesforce", + filter: { + name: "Main Operating", + status: "active", + }, + sort: {}, + passThrough: { + "search": "San Francisco", + }, + fields: "id,updated_at", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *boolean* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `consumerId` | *string* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *string* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `serviceId` | *string* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `cursor` | *string* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *number* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter` | [components.BankAccountsFilter](../../models/components/bankaccountsfilter.md) | :heavy_minus_sign: | Apply filters | | +| `sort` | [components.BankAccountsSort](../../models/components/bankaccountssort.md) | :heavy_minus_sign: | Apply sorting | | +| `passThrough` | Record | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *string* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | \ No newline at end of file diff --git a/docs/models/operations/accountingbankaccountsallresponse.md b/docs/models/operations/accountingbankaccountsallresponse.md new file mode 100644 index 00000000..b03c3f4d --- /dev/null +++ b/docs/models/operations/accountingbankaccountsallresponse.md @@ -0,0 +1,17 @@ +# AccountingBankAccountsAllResponse + +## Example Usage + +```typescript +import { AccountingBankAccountsAllResponse } from "@apideck/unify/models/operations"; + +let value: AccountingBankAccountsAllResponse = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `getBankAccountsResponse` | [components.GetBankAccountsResponse](../../models/components/getbankaccountsresponse.md) | :heavy_minus_sign: | Bank Accounts | +| `unexpectedErrorResponse` | [components.UnexpectedErrorResponse](../../models/components/unexpectederrorresponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/operations/accountingbankaccountsdeleteglobals.md b/docs/models/operations/accountingbankaccountsdeleteglobals.md new file mode 100644 index 00000000..4f0c50a4 --- /dev/null +++ b/docs/models/operations/accountingbankaccountsdeleteglobals.md @@ -0,0 +1,19 @@ +# AccountingBankAccountsDeleteGlobals + +## Example Usage + +```typescript +import { AccountingBankAccountsDeleteGlobals } from "@apideck/unify/models/operations"; + +let value: AccountingBankAccountsDeleteGlobals = { + consumerId: "test-consumer", + appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `consumerId` | *string* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *string* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | \ No newline at end of file diff --git a/docs/models/operations/accountingbankaccountsdeleterequest.md b/docs/models/operations/accountingbankaccountsdeleterequest.md new file mode 100644 index 00000000..2dbc006c --- /dev/null +++ b/docs/models/operations/accountingbankaccountsdeleterequest.md @@ -0,0 +1,22 @@ +# AccountingBankAccountsDeleteRequest + +## Example Usage + +```typescript +import { AccountingBankAccountsDeleteRequest } from "@apideck/unify/models/operations"; + +let value: AccountingBankAccountsDeleteRequest = { + id: "", + serviceId: "salesforce", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `consumerId` | *string* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *string* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `serviceId` | *string* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `raw` | *boolean* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | \ No newline at end of file diff --git a/docs/models/operations/accountingbankaccountsdeleteresponse.md b/docs/models/operations/accountingbankaccountsdeleteresponse.md new file mode 100644 index 00000000..6b08f3f3 --- /dev/null +++ b/docs/models/operations/accountingbankaccountsdeleteresponse.md @@ -0,0 +1,17 @@ +# AccountingBankAccountsDeleteResponse + +## Example Usage + +```typescript +import { AccountingBankAccountsDeleteResponse } from "@apideck/unify/models/operations"; + +let value: AccountingBankAccountsDeleteResponse = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `deleteBankAccountResponse` | [components.DeleteBankAccountResponse](../../models/components/deletebankaccountresponse.md) | :heavy_minus_sign: | Bank Account deleted | +| `unexpectedErrorResponse` | [components.UnexpectedErrorResponse](../../models/components/unexpectederrorresponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/operations/accountingbankaccountsoneglobals.md b/docs/models/operations/accountingbankaccountsoneglobals.md new file mode 100644 index 00000000..b5be8b79 --- /dev/null +++ b/docs/models/operations/accountingbankaccountsoneglobals.md @@ -0,0 +1,19 @@ +# AccountingBankAccountsOneGlobals + +## Example Usage + +```typescript +import { AccountingBankAccountsOneGlobals } from "@apideck/unify/models/operations"; + +let value: AccountingBankAccountsOneGlobals = { + consumerId: "test-consumer", + appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `consumerId` | *string* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *string* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | \ No newline at end of file diff --git a/docs/models/operations/accountingbankaccountsonerequest.md b/docs/models/operations/accountingbankaccountsonerequest.md new file mode 100644 index 00000000..3eea8e15 --- /dev/null +++ b/docs/models/operations/accountingbankaccountsonerequest.md @@ -0,0 +1,24 @@ +# AccountingBankAccountsOneRequest + +## Example Usage + +```typescript +import { AccountingBankAccountsOneRequest } from "@apideck/unify/models/operations"; + +let value: AccountingBankAccountsOneRequest = { + id: "", + serviceId: "salesforce", + fields: "id,updated_at", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `consumerId` | *string* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *string* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `serviceId` | *string* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `raw` | *boolean* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `fields` | *string* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | \ No newline at end of file diff --git a/docs/models/operations/accountingbankaccountsoneresponse.md b/docs/models/operations/accountingbankaccountsoneresponse.md new file mode 100644 index 00000000..345d7a16 --- /dev/null +++ b/docs/models/operations/accountingbankaccountsoneresponse.md @@ -0,0 +1,17 @@ +# AccountingBankAccountsOneResponse + +## Example Usage + +```typescript +import { AccountingBankAccountsOneResponse } from "@apideck/unify/models/operations"; + +let value: AccountingBankAccountsOneResponse = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `getBankAccountResponse` | [components.GetBankAccountResponse](../../models/components/getbankaccountresponse.md) | :heavy_minus_sign: | Bank Account | +| `unexpectedErrorResponse` | [components.UnexpectedErrorResponse](../../models/components/unexpectederrorresponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/operations/accountingbankaccountsupdateglobals.md b/docs/models/operations/accountingbankaccountsupdateglobals.md new file mode 100644 index 00000000..a1e1f3d8 --- /dev/null +++ b/docs/models/operations/accountingbankaccountsupdateglobals.md @@ -0,0 +1,19 @@ +# AccountingBankAccountsUpdateGlobals + +## Example Usage + +```typescript +import { AccountingBankAccountsUpdateGlobals } from "@apideck/unify/models/operations"; + +let value: AccountingBankAccountsUpdateGlobals = { + consumerId: "test-consumer", + appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `consumerId` | *string* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *string* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | \ No newline at end of file diff --git a/docs/models/operations/accountingbankaccountsupdaterequest.md b/docs/models/operations/accountingbankaccountsupdaterequest.md new file mode 100644 index 00000000..2dc7f187 --- /dev/null +++ b/docs/models/operations/accountingbankaccountsupdaterequest.md @@ -0,0 +1,51 @@ +# AccountingBankAccountsUpdateRequest + +## Example Usage + +```typescript +import { AccountingBankAccountsUpdateRequest } from "@apideck/unify/models/operations"; + +let value: AccountingBankAccountsUpdateRequest = { + id: "", + serviceId: "salesforce", + accountingBankAccount: { + displayId: "BA-001", + name: "Main Operating Account", + accountNumber: "1234567890", + accountType: "checking", + bankName: "Chase Bank", + currency: "USD", + balance: 25000, + availableBalance: 24500, + overdraftLimit: 5000, + routingNumber: "021000021", + iban: "GB33BUKB20201555555555", + bic: "CHASUS33", + bsbNumber: "062-001", + branchIdentifier: "001", + bankCode: "BNH", + country: "US", + status: "active", + description: "Primary operating account for daily transactions", + customFields: [ + { + id: "2389328923893298", + name: "employee_level", + description: "Employee Level", + value: "Uses Salesforce and Marketo", + }, + ], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `consumerId` | *string* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *string* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `serviceId` | *string* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `raw` | *boolean* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `accountingBankAccount` | [components.AccountingBankAccountInput](../../models/components/accountingbankaccountinput.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/accountingbankaccountsupdateresponse.md b/docs/models/operations/accountingbankaccountsupdateresponse.md new file mode 100644 index 00000000..c43002f3 --- /dev/null +++ b/docs/models/operations/accountingbankaccountsupdateresponse.md @@ -0,0 +1,17 @@ +# AccountingBankAccountsUpdateResponse + +## Example Usage + +```typescript +import { AccountingBankAccountsUpdateResponse } from "@apideck/unify/models/operations"; + +let value: AccountingBankAccountsUpdateResponse = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `updateBankAccountResponse` | [components.UpdateBankAccountResponse](../../models/components/updatebankaccountresponse.md) | :heavy_minus_sign: | Bank Account updated | +| `unexpectedErrorResponse` | [components.UnexpectedErrorResponse](../../models/components/unexpectederrorresponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/operations/vaultconnectionsettingsupdaterequest.md b/docs/models/operations/vaultconnectionsettingsupdaterequest.md index 7ecaac85..6377b0a7 100644 --- a/docs/models/operations/vaultconnectionsettingsupdaterequest.md +++ b/docs/models/operations/vaultconnectionsettingsupdaterequest.md @@ -31,7 +31,14 @@ let value: VaultConnectionSettingsUpdateRequest = { options: [ { label: "General Channel", - optionType: "simple", + options: [ + { + label: "General Channel", + value: "general", + optionType: "simple", + }, + ], + optionType: "group", }, ], value: "GC5000 series", diff --git a/docs/models/operations/vaultconnectionsupdaterequest.md b/docs/models/operations/vaultconnectionsupdaterequest.md index 54fe4103..049ab21d 100644 --- a/docs/models/operations/vaultconnectionsupdaterequest.md +++ b/docs/models/operations/vaultconnectionsupdaterequest.md @@ -30,7 +30,14 @@ let value: VaultConnectionsUpdateRequest = { options: [ { label: "General Channel", - optionType: "simple", + options: [ + { + label: "General Channel", + value: "general", + optionType: "simple", + }, + ], + optionType: "group", }, ], value: "GC5000 series", diff --git a/docs/models/operations/vaultlogsallrequest.md b/docs/models/operations/vaultlogsallrequest.md index 377252f0..965ae09a 100644 --- a/docs/models/operations/vaultlogsallrequest.md +++ b/docs/models/operations/vaultlogsallrequest.md @@ -9,6 +9,11 @@ let value: VaultLogsAllRequest = { filter: { connectorId: "crm+salesforce", statusCode: 201, + statusCodes: [ + 200, + 201, + 204, + ], excludeUnifiedApis: "vault,proxy", }, }; diff --git a/docs/sdks/bankaccounts/README.md b/docs/sdks/bankaccounts/README.md new file mode 100644 index 00000000..7e063ab3 --- /dev/null +++ b/docs/sdks/bankaccounts/README.md @@ -0,0 +1,564 @@ +# BankAccounts +(*accounting.bankAccounts*) + +## Overview + +### Available Operations + +* [list](#list) - List Bank Accounts +* [create](#create) - Create Bank Account +* [get](#get) - Get Bank Account +* [update](#update) - Update Bank Account +* [delete](#delete) - Delete Bank Account + +## list + +List Bank Accounts + +### Example Usage + + +```typescript +import { Apideck } from "@apideck/unify"; + +const apideck = new Apideck({ + consumerId: "test-consumer", + appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", + apiKey: process.env["APIDECK_API_KEY"] ?? "", +}); + +async function run() { + const result = await apideck.accounting.bankAccounts.list({ + serviceId: "salesforce", + filter: { + name: "Main Operating", + status: "active", + }, + sort: {}, + passThrough: { + "search": "San Francisco", + }, + fields: "id,updated_at", + }); + + for await (const page of result) { + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { ApideckCore } from "@apideck/unify/core.js"; +import { accountingBankAccountsList } from "@apideck/unify/funcs/accountingBankAccountsList.js"; + +// Use `ApideckCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const apideck = new ApideckCore({ + consumerId: "test-consumer", + appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", + apiKey: process.env["APIDECK_API_KEY"] ?? "", +}); + +async function run() { + const res = await accountingBankAccountsList(apideck, { + serviceId: "salesforce", + filter: { + name: "Main Operating", + status: "active", + }, + sort: {}, + passThrough: { + "search": "San Francisco", + }, + fields: "id,updated_at", + }); + if (res.ok) { + const { value: result } = res; + for await (const page of result) { + console.log(page); + } + } else { + console.log("accountingBankAccountsList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.AccountingBankAccountsAllRequest](../../models/operations/accountingbankaccountsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.AccountingBankAccountsAllResponse](../../models/operations/accountingbankaccountsallresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------ | ------------------------------ | ------------------------------ | +| errors.BadRequestResponse | 400 | application/json | +| errors.UnauthorizedResponse | 401 | application/json | +| errors.PaymentRequiredResponse | 402 | application/json | +| errors.NotFoundResponse | 404 | application/json | +| errors.UnprocessableResponse | 422 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## create + +Create Bank Account + +### Example Usage + + +```typescript +import { Apideck } from "@apideck/unify"; + +const apideck = new Apideck({ + consumerId: "test-consumer", + appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", + apiKey: process.env["APIDECK_API_KEY"] ?? "", +}); + +async function run() { + const result = await apideck.accounting.bankAccounts.create({ + serviceId: "salesforce", + accountingBankAccount: { + displayId: "BA-001", + name: "Main Operating Account", + accountNumber: "1234567890", + accountType: "checking", + bankName: "Chase Bank", + currency: "USD", + balance: 25000, + availableBalance: 24500, + overdraftLimit: 5000, + routingNumber: "021000021", + iban: "GB33BUKB20201555555555", + bic: "CHASUS33", + bsbNumber: "062-001", + branchIdentifier: "001", + bankCode: "BNH", + country: "US", + status: "active", + description: "Primary operating account for daily transactions", + customFields: [ + { + id: "2389328923893298", + name: "employee_level", + description: "Employee Level", + value: "Uses Salesforce and Marketo", + }, + ], + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { ApideckCore } from "@apideck/unify/core.js"; +import { accountingBankAccountsCreate } from "@apideck/unify/funcs/accountingBankAccountsCreate.js"; + +// Use `ApideckCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const apideck = new ApideckCore({ + consumerId: "test-consumer", + appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", + apiKey: process.env["APIDECK_API_KEY"] ?? "", +}); + +async function run() { + const res = await accountingBankAccountsCreate(apideck, { + serviceId: "salesforce", + accountingBankAccount: { + displayId: "BA-001", + name: "Main Operating Account", + accountNumber: "1234567890", + accountType: "checking", + bankName: "Chase Bank", + currency: "USD", + balance: 25000, + availableBalance: 24500, + overdraftLimit: 5000, + routingNumber: "021000021", + iban: "GB33BUKB20201555555555", + bic: "CHASUS33", + bsbNumber: "062-001", + branchIdentifier: "001", + bankCode: "BNH", + country: "US", + status: "active", + description: "Primary operating account for daily transactions", + customFields: [ + { + id: "2389328923893298", + name: "employee_level", + description: "Employee Level", + value: "Uses Salesforce and Marketo", + }, + ], + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("accountingBankAccountsCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.AccountingBankAccountsAddRequest](../../models/operations/accountingbankaccountsaddrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.AccountingBankAccountsAddResponse](../../models/operations/accountingbankaccountsaddresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------ | ------------------------------ | ------------------------------ | +| errors.BadRequestResponse | 400 | application/json | +| errors.UnauthorizedResponse | 401 | application/json | +| errors.PaymentRequiredResponse | 402 | application/json | +| errors.NotFoundResponse | 404 | application/json | +| errors.UnprocessableResponse | 422 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## get + +Get Bank Account + +### Example Usage + + +```typescript +import { Apideck } from "@apideck/unify"; + +const apideck = new Apideck({ + consumerId: "test-consumer", + appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", + apiKey: process.env["APIDECK_API_KEY"] ?? "", +}); + +async function run() { + const result = await apideck.accounting.bankAccounts.get({ + id: "", + serviceId: "salesforce", + fields: "id,updated_at", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { ApideckCore } from "@apideck/unify/core.js"; +import { accountingBankAccountsGet } from "@apideck/unify/funcs/accountingBankAccountsGet.js"; + +// Use `ApideckCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const apideck = new ApideckCore({ + consumerId: "test-consumer", + appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", + apiKey: process.env["APIDECK_API_KEY"] ?? "", +}); + +async function run() { + const res = await accountingBankAccountsGet(apideck, { + id: "", + serviceId: "salesforce", + fields: "id,updated_at", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("accountingBankAccountsGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.AccountingBankAccountsOneRequest](../../models/operations/accountingbankaccountsonerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.AccountingBankAccountsOneResponse](../../models/operations/accountingbankaccountsoneresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------ | ------------------------------ | ------------------------------ | +| errors.BadRequestResponse | 400 | application/json | +| errors.UnauthorizedResponse | 401 | application/json | +| errors.PaymentRequiredResponse | 402 | application/json | +| errors.NotFoundResponse | 404 | application/json | +| errors.UnprocessableResponse | 422 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## update + +Update Bank Account + +### Example Usage + + +```typescript +import { Apideck } from "@apideck/unify"; + +const apideck = new Apideck({ + consumerId: "test-consumer", + appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", + apiKey: process.env["APIDECK_API_KEY"] ?? "", +}); + +async function run() { + const result = await apideck.accounting.bankAccounts.update({ + id: "", + serviceId: "salesforce", + accountingBankAccount: { + displayId: "BA-001", + name: "Main Operating Account", + accountNumber: "1234567890", + accountType: "checking", + bankName: "Chase Bank", + currency: "USD", + balance: 25000, + availableBalance: 24500, + overdraftLimit: 5000, + routingNumber: "021000021", + iban: "GB33BUKB20201555555555", + bic: "CHASUS33", + bsbNumber: "062-001", + branchIdentifier: "001", + bankCode: "BNH", + country: "US", + status: "active", + description: "Primary operating account for daily transactions", + customFields: [ + { + id: "2389328923893298", + name: "employee_level", + description: "Employee Level", + value: "Uses Salesforce and Marketo", + }, + ], + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { ApideckCore } from "@apideck/unify/core.js"; +import { accountingBankAccountsUpdate } from "@apideck/unify/funcs/accountingBankAccountsUpdate.js"; + +// Use `ApideckCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const apideck = new ApideckCore({ + consumerId: "test-consumer", + appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", + apiKey: process.env["APIDECK_API_KEY"] ?? "", +}); + +async function run() { + const res = await accountingBankAccountsUpdate(apideck, { + id: "", + serviceId: "salesforce", + accountingBankAccount: { + displayId: "BA-001", + name: "Main Operating Account", + accountNumber: "1234567890", + accountType: "checking", + bankName: "Chase Bank", + currency: "USD", + balance: 25000, + availableBalance: 24500, + overdraftLimit: 5000, + routingNumber: "021000021", + iban: "GB33BUKB20201555555555", + bic: "CHASUS33", + bsbNumber: "062-001", + branchIdentifier: "001", + bankCode: "BNH", + country: "US", + status: "active", + description: "Primary operating account for daily transactions", + customFields: [ + { + id: "2389328923893298", + name: "employee_level", + description: "Employee Level", + value: "Uses Salesforce and Marketo", + }, + ], + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("accountingBankAccountsUpdate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.AccountingBankAccountsUpdateRequest](../../models/operations/accountingbankaccountsupdaterequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.AccountingBankAccountsUpdateResponse](../../models/operations/accountingbankaccountsupdateresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------ | ------------------------------ | ------------------------------ | +| errors.BadRequestResponse | 400 | application/json | +| errors.UnauthorizedResponse | 401 | application/json | +| errors.PaymentRequiredResponse | 402 | application/json | +| errors.NotFoundResponse | 404 | application/json | +| errors.UnprocessableResponse | 422 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## delete + +Delete Bank Account + +### Example Usage + + +```typescript +import { Apideck } from "@apideck/unify"; + +const apideck = new Apideck({ + consumerId: "test-consumer", + appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", + apiKey: process.env["APIDECK_API_KEY"] ?? "", +}); + +async function run() { + const result = await apideck.accounting.bankAccounts.delete({ + id: "", + serviceId: "salesforce", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { ApideckCore } from "@apideck/unify/core.js"; +import { accountingBankAccountsDelete } from "@apideck/unify/funcs/accountingBankAccountsDelete.js"; + +// Use `ApideckCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const apideck = new ApideckCore({ + consumerId: "test-consumer", + appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", + apiKey: process.env["APIDECK_API_KEY"] ?? "", +}); + +async function run() { + const res = await accountingBankAccountsDelete(apideck, { + id: "", + serviceId: "salesforce", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("accountingBankAccountsDelete failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.AccountingBankAccountsDeleteRequest](../../models/operations/accountingbankaccountsdeleterequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.AccountingBankAccountsDeleteResponse](../../models/operations/accountingbankaccountsdeleteresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------ | ------------------------------ | ------------------------------ | +| errors.BadRequestResponse | 400 | application/json | +| errors.UnauthorizedResponse | 401 | application/json | +| errors.PaymentRequiredResponse | 402 | application/json | +| errors.NotFoundResponse | 404 | application/json | +| errors.UnprocessableResponse | 422 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/examples/accountingTaxRatesList.example.ts b/examples/accountingTaxRatesList.example.ts index 5fb157a7..84aa9a3d 100644 --- a/examples/accountingTaxRatesList.example.ts +++ b/examples/accountingTaxRatesList.example.ts @@ -20,7 +20,7 @@ const apideck = new Apideck({ }); async function main() { - const result = await apideck.list({ + const result = await apideck.accounting.taxRates.list({ serviceId: "salesforce", filter: { assets: true, diff --git a/examples/package-lock.json b/examples/package-lock.json index b3d91006..1810388b 100644 --- a/examples/package-lock.json +++ b/examples/package-lock.json @@ -18,7 +18,7 @@ }, "..": { "name": "@apideck/unify", - "version": "0.29.8", + "version": "0.29.9", "dependencies": { "zod": "^3.20.0" }, diff --git a/jsr.json b/jsr.json index 85eea5f9..4c7ac486 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@apideck/unify", - "version": "0.29.8", + "version": "0.29.9", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 50f6905b..4e5ac8be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@apideck/unify", - "version": "0.29.8", + "version": "0.29.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@apideck/unify", - "version": "0.29.8", + "version": "0.29.9", "dependencies": { "zod": "^3.20.0" }, diff --git a/package.json b/package.json index 2268fa75..449ca109 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@apideck/unify", - "version": "0.29.8", + "version": "0.29.9", "author": "Speakeasy", "main": "./index.js", "sideEffects": false, diff --git a/src/__tests__/bankaccounts.test.ts b/src/__tests__/bankaccounts.test.ts new file mode 100644 index 00000000..c959a222 --- /dev/null +++ b/src/__tests__/bankaccounts.test.ts @@ -0,0 +1,293 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { expect, test } from "vitest"; +import { Apideck } from "../index.js"; +import { createTestHTTPClient } from "./testclient.js"; + +test("Bankaccounts Accounting Bank Accounts All", async () => { + const testHttpClient = createTestHTTPClient("accounting.bankAccountsAll"); + + const apideck = new Apideck({ + serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080", + httpClient: testHttpClient, + apiKey: process.env["APIDECK_API_KEY"] ?? "value", + }); + + const result = await apideck.accounting.bankAccounts.list({ + consumerId: "test-consumer", + appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", + serviceId: "salesforce", + filter: { + name: "Main Operating", + status: "active", + }, + sort: {}, + passThrough: { + "search": "San Francisco", + }, + fields: "id,updated_at", + }); + expect(result.httpMeta.response.status).toBe(200); + expect(result.getBankAccountsResponse).toBeDefined(); + expect(result.getBankAccountsResponse).toEqual({ + statusCode: 200, + status: "OK", + service: "quickbooks", + resource: "bank-accounts", + operation: "all", + data: [ + { + id: "12345", + displayId: "BA-001", + name: "Main Operating Account", + accountNumber: "1234567890", + accountType: "checking", + bankName: "Chase Bank", + currency: "USD", + balance: 25000, + availableBalance: 24500, + overdraftLimit: 5000, + routingNumber: "021000021", + iban: "GB33BUKB20201555555555", + bic: "CHASUS33", + bsbNumber: "062-001", + branchIdentifier: "001", + bankCode: "BNH", + country: "US", + status: "active", + description: "Primary operating account for daily transactions", + customFields: [ + { + id: "2389328923893298", + name: "employee_level", + description: "Employee Level", + value: "Uses Salesforce and Marketo", + }, + ], + createdAt: new Date("2020-09-30T07:43:32.000Z"), + updatedAt: new Date("2020-09-30T07:43:32.000Z"), + createdBy: "12345", + updatedBy: "12345", + }, + ], + meta: { + itemsOnPage: 50, + cursors: { + previous: "em9oby1jcm06OnBhZ2U6OjE=", + current: "em9oby1jcm06OnBhZ2U6OjI=", + next: "em9oby1jcm06OnBhZ2U6OjM=", + }, + }, + links: { + previous: + "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D", + current: "https://unify.apideck.com/crm/companies", + next: + "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM", + }, + }); +}); + +test("Bankaccounts Accounting Bank Accounts Add", async () => { + const testHttpClient = createTestHTTPClient("accounting.bankAccountsAdd"); + + const apideck = new Apideck({ + serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080", + httpClient: testHttpClient, + apiKey: process.env["APIDECK_API_KEY"] ?? "value", + }); + + const result = await apideck.accounting.bankAccounts.create({ + consumerId: "test-consumer", + appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", + serviceId: "salesforce", + accountingBankAccount: { + displayId: "BA-001", + name: "Main Operating Account", + accountNumber: "1234567890", + accountType: "checking", + bankName: "Chase Bank", + currency: "USD", + balance: 25000, + availableBalance: 24500, + overdraftLimit: 5000, + routingNumber: "021000021", + iban: "GB33BUKB20201555555555", + bic: "CHASUS33", + bsbNumber: "062-001", + branchIdentifier: "001", + bankCode: "BNH", + country: "US", + status: "active", + description: "Primary operating account for daily transactions", + customFields: [ + { + id: "2389328923893298", + name: "employee_level", + description: "Employee Level", + value: "Uses Salesforce and Marketo", + }, + ], + }, + }); + expect(result.httpMeta.response.status).toBe(201); + expect(result.createBankAccountResponse).toBeDefined(); + expect(result.createBankAccountResponse).toEqual({ + statusCode: 201, + status: "Created", + service: "quickbooks", + resource: "bank-accounts", + operation: "add", + data: { + id: "12345", + }, + }); +}); + +test("Bankaccounts Accounting Bank Accounts One", async () => { + const testHttpClient = createTestHTTPClient("accounting.bankAccountsOne"); + + const apideck = new Apideck({ + serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080", + httpClient: testHttpClient, + apiKey: process.env["APIDECK_API_KEY"] ?? "value", + }); + + const result = await apideck.accounting.bankAccounts.get({ + id: "", + consumerId: "test-consumer", + appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", + serviceId: "salesforce", + fields: "id,updated_at", + }); + expect(result.httpMeta.response.status).toBe(200); + expect(result.getBankAccountResponse).toBeDefined(); + expect(result.getBankAccountResponse).toEqual({ + statusCode: 200, + status: "OK", + service: "quickbooks", + resource: "bank-accounts", + operation: "one", + data: { + id: "12345", + displayId: "BA-001", + name: "Main Operating Account", + accountNumber: "1234567890", + accountType: "checking", + bankName: "Chase Bank", + currency: "USD", + balance: 25000, + availableBalance: 24500, + overdraftLimit: 5000, + routingNumber: "021000021", + iban: "GB33BUKB20201555555555", + bic: "CHASUS33", + bsbNumber: "062-001", + branchIdentifier: "001", + bankCode: "BNH", + country: "US", + status: "active", + description: "Primary operating account for daily transactions", + customFields: [ + { + id: "2389328923893298", + name: "employee_level", + description: "Employee Level", + value: "Uses Salesforce and Marketo", + }, + ], + createdAt: new Date("2020-09-30T07:43:32.000Z"), + updatedAt: new Date("2020-09-30T07:43:32.000Z"), + createdBy: "12345", + updatedBy: "12345", + }, + }); +}); + +test("Bankaccounts Accounting Bank Accounts Update", async () => { + const testHttpClient = createTestHTTPClient("accounting.bankAccountsUpdate"); + + const apideck = new Apideck({ + serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080", + httpClient: testHttpClient, + apiKey: process.env["APIDECK_API_KEY"] ?? "value", + }); + + const result = await apideck.accounting.bankAccounts.update({ + id: "", + consumerId: "test-consumer", + appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", + serviceId: "salesforce", + accountingBankAccount: { + displayId: "BA-001", + name: "Main Operating Account", + accountNumber: "1234567890", + accountType: "checking", + bankName: "Chase Bank", + currency: "USD", + balance: 25000, + availableBalance: 24500, + overdraftLimit: 5000, + routingNumber: "021000021", + iban: "GB33BUKB20201555555555", + bic: "CHASUS33", + bsbNumber: "062-001", + branchIdentifier: "001", + bankCode: "BNH", + country: "US", + status: "active", + description: "Primary operating account for daily transactions", + customFields: [ + { + id: "2389328923893298", + name: "employee_level", + description: "Employee Level", + value: "Uses Salesforce and Marketo", + }, + ], + }, + }); + expect(result.httpMeta.response.status).toBe(200); + expect(result.updateBankAccountResponse).toBeDefined(); + expect(result.updateBankAccountResponse).toEqual({ + statusCode: 200, + status: "OK", + service: "quickbooks", + resource: "bank-accounts", + operation: "update", + data: { + id: "12345", + }, + }); +}); + +test("Bankaccounts Accounting Bank Accounts Delete", async () => { + const testHttpClient = createTestHTTPClient("accounting.bankAccountsDelete"); + + const apideck = new Apideck({ + serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080", + httpClient: testHttpClient, + apiKey: process.env["APIDECK_API_KEY"] ?? "value", + }); + + const result = await apideck.accounting.bankAccounts.delete({ + id: "", + consumerId: "test-consumer", + appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", + serviceId: "salesforce", + }); + expect(result.httpMeta.response.status).toBe(200); + expect(result.deleteBankAccountResponse).toBeDefined(); + expect(result.deleteBankAccountResponse).toEqual({ + statusCode: 200, + status: "OK", + service: "quickbooks", + resource: "bank-accounts", + operation: "delete", + data: { + id: "12345", + }, + }); +}); diff --git a/src/__tests__/mockserver/internal/handler/generated_handlers.go b/src/__tests__/mockserver/internal/handler/generated_handlers.go index aca6db30..9ed8307e 100644 --- a/src/__tests__/mockserver/internal/handler/generated_handlers.go +++ b/src/__tests__/mockserver/internal/handler/generated_handlers.go @@ -13,6 +13,7 @@ import ( func GeneratedHandlers(ctx context.Context, dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) []*GeneratedHandler { return []*GeneratedHandler{ NewGeneratedHandler(ctx, http.MethodDelete, "/accounting/attachments/{reference_type}/{reference_id}/{id}", pathDeleteAccountingAttachmentsReferenceTypeReferenceIDID(dir, rt)), + NewGeneratedHandler(ctx, http.MethodDelete, "/accounting/bank-accounts/{id}", pathDeleteAccountingBankAccountsID(dir, rt)), NewGeneratedHandler(ctx, http.MethodDelete, "/accounting/bank-feed-accounts/{id}", pathDeleteAccountingBankFeedAccountsID(dir, rt)), NewGeneratedHandler(ctx, http.MethodDelete, "/accounting/bank-feed-statements/{id}", pathDeleteAccountingBankFeedStatementsID(dir, rt)), NewGeneratedHandler(ctx, http.MethodDelete, "/accounting/bill-payments/{id}", pathDeleteAccountingBillPaymentsID(dir, rt)), @@ -67,6 +68,8 @@ func GeneratedHandlers(ctx context.Context, dir *logging.HTTPFileDirectory, rt * NewGeneratedHandler(ctx, http.MethodGet, "/accounting/attachments/{reference_type}/{reference_id}/{id}", pathGetAccountingAttachmentsReferenceTypeReferenceIDID(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/accounting/attachments/{reference_type}/{reference_id}/{id}/download", pathGetAccountingAttachmentsReferenceTypeReferenceIDIDDownload(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/accounting/balance-sheet", pathGetAccountingBalanceSheet(dir, rt)), + NewGeneratedHandler(ctx, http.MethodGet, "/accounting/bank-accounts", pathGetAccountingBankAccounts(dir, rt)), + NewGeneratedHandler(ctx, http.MethodGet, "/accounting/bank-accounts/{id}", pathGetAccountingBankAccountsID(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/accounting/bank-feed-accounts", pathGetAccountingBankFeedAccounts(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/accounting/bank-feed-accounts/{id}", pathGetAccountingBankFeedAccountsID(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/accounting/bank-feed-statements", pathGetAccountingBankFeedStatements(dir, rt)), @@ -200,6 +203,7 @@ func GeneratedHandlers(ctx context.Context, dir *logging.HTTPFileDirectory, rt * NewGeneratedHandler(ctx, http.MethodGet, "/webhook/logs", pathGetWebhookLogs(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/webhook/webhooks", pathGetWebhookWebhooks(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/webhook/webhooks/{id}", pathGetWebhookWebhooksID(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPatch, "/accounting/bank-accounts/{id}", pathPatchAccountingBankAccountsID(dir, rt)), NewGeneratedHandler(ctx, http.MethodPatch, "/accounting/bank-feed-accounts/{id}", pathPatchAccountingBankFeedAccountsID(dir, rt)), NewGeneratedHandler(ctx, http.MethodPatch, "/accounting/bank-feed-statements/{id}", pathPatchAccountingBankFeedStatementsID(dir, rt)), NewGeneratedHandler(ctx, http.MethodPatch, "/accounting/bill-payments/{id}", pathPatchAccountingBillPaymentsID(dir, rt)), @@ -249,6 +253,7 @@ func GeneratedHandlers(ctx context.Context, dir *logging.HTTPFileDirectory, rt * NewGeneratedHandler(ctx, http.MethodPatch, "/vault/connections/{unified_api}/{service_id}/{resource}/config", pathPatchVaultConnectionsUnifiedAPIServiceIDResourceConfig(dir, rt)), NewGeneratedHandler(ctx, http.MethodPatch, "/vault/consumers/{consumer_id}", pathPatchVaultConsumersConsumerID(dir, rt)), NewGeneratedHandler(ctx, http.MethodPatch, "/webhook/webhooks/{id}", pathPatchWebhookWebhooksID(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/accounting/bank-accounts", pathPostAccountingBankAccounts(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/accounting/bank-feed-accounts", pathPostAccountingBankFeedAccounts(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/accounting/bank-feed-statements", pathPostAccountingBankFeedStatements(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/accounting/bill-payments", pathPostAccountingBillPayments(dir, rt)), diff --git a/src/__tests__/mockserver/internal/handler/pathdeleteaccountingbankaccountsid.go b/src/__tests__/mockserver/internal/handler/pathdeleteaccountingbankaccountsid.go new file mode 100644 index 00000000..2c6a2da6 --- /dev/null +++ b/src/__tests__/mockserver/internal/handler/pathdeleteaccountingbankaccountsid.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathDeleteAccountingBankAccountsID(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "accounting.bankAccountsDelete[0]": + dir.HandlerFunc("accounting.bankAccountsDelete", testAccountingBankAccountsDeleteAccountingBankAccountsDelete0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testAccountingBankAccountsDeleteAccountingBankAccountsDelete0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.DeleteBankAccountResponse = &components.DeleteBankAccountResponse{ + StatusCode: 200, + Status: "OK", + Service: types.String("quickbooks"), + Resource: types.String("bank-accounts"), + Operation: types.String("delete"), + Data: components.UnifiedID{ + ID: "12345", + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/src/__tests__/mockserver/internal/handler/pathgetaccountingbankaccounts.go b/src/__tests__/mockserver/internal/handler/pathgetaccountingbankaccounts.go new file mode 100644 index 00000000..0407002a --- /dev/null +++ b/src/__tests__/mockserver/internal/handler/pathgetaccountingbankaccounts.go @@ -0,0 +1,119 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathGetAccountingBankAccounts(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "accounting.bankAccountsAll[0]": + dir.HandlerFunc("accounting.bankAccountsAll", testAccountingBankAccountsAllAccountingBankAccountsAll0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testAccountingBankAccountsAllAccountingBankAccountsAll0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.GetBankAccountsResponse = &components.GetBankAccountsResponse{ + StatusCode: 200, + Status: "OK", + Service: types.String("quickbooks"), + Resource: types.String("bank-accounts"), + Operation: types.String("all"), + Data: []components.AccountingBankAccount{ + components.AccountingBankAccount{ + ID: "12345", + DisplayID: types.String("BA-001"), + Name: types.String("Main Operating Account"), + AccountNumber: types.String("1234567890"), + AccountType: components.AccountingBankAccountAccountTypeChecking.ToPointer(), + BankName: types.String("Chase Bank"), + Currency: components.CurrencyUsd.ToPointer(), + Balance: types.Float64(25000), + AvailableBalance: types.Float64(24500), + OverdraftLimit: types.Float64(5000), + RoutingNumber: types.String("021000021"), + Iban: types.String("GB33BUKB20201555555555"), + Bic: types.String("CHASUS33"), + BsbNumber: types.String("062-001"), + BranchIdentifier: types.String("001"), + BankCode: types.String("BNH"), + Country: types.String("US"), + Status: components.AccountingBankAccountStatusActive.ToPointer(), + Description: types.String("Primary operating account for daily transactions"), + CustomFields: []components.CustomField{ + components.CustomField{ + ID: types.String("2389328923893298"), + Name: types.String("employee_level"), + Description: types.String("Employee Level"), + Value: types.Pointer(components.CreateCustomFieldValue2Str( + "Uses Salesforce and Marketo", + )), + }, + }, + CreatedAt: types.MustNewTimeFromString("2020-09-30T07:43:32.000Z"), + UpdatedAt: types.MustNewTimeFromString("2020-09-30T07:43:32.000Z"), + CreatedBy: types.String("12345"), + UpdatedBy: types.String("12345"), + }, + }, + Meta: &components.Meta{ + ItemsOnPage: types.Int64(50), + Cursors: &components.Cursors{ + Previous: types.String("em9oby1jcm06OnBhZ2U6OjE="), + Current: types.String("em9oby1jcm06OnBhZ2U6OjI="), + Next: types.String("em9oby1jcm06OnBhZ2U6OjM="), + }, + }, + Links: &components.Links{ + Previous: types.String("https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D"), + Current: types.String("https://unify.apideck.com/crm/companies"), + Next: types.String("https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM"), + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/src/__tests__/mockserver/internal/handler/pathgetaccountingbankaccountsid.go b/src/__tests__/mockserver/internal/handler/pathgetaccountingbankaccountsid.go new file mode 100644 index 00000000..a08beba7 --- /dev/null +++ b/src/__tests__/mockserver/internal/handler/pathgetaccountingbankaccountsid.go @@ -0,0 +1,104 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathGetAccountingBankAccountsID(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "accounting.bankAccountsOne[0]": + dir.HandlerFunc("accounting.bankAccountsOne", testAccountingBankAccountsOneAccountingBankAccountsOne0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testAccountingBankAccountsOneAccountingBankAccountsOne0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.GetBankAccountResponse = &components.GetBankAccountResponse{ + StatusCode: 200, + Status: "OK", + Service: types.String("quickbooks"), + Resource: types.String("bank-accounts"), + Operation: types.String("one"), + Data: components.AccountingBankAccount{ + ID: "12345", + DisplayID: types.String("BA-001"), + Name: types.String("Main Operating Account"), + AccountNumber: types.String("1234567890"), + AccountType: components.AccountingBankAccountAccountTypeChecking.ToPointer(), + BankName: types.String("Chase Bank"), + Currency: components.CurrencyUsd.ToPointer(), + Balance: types.Float64(25000), + AvailableBalance: types.Float64(24500), + OverdraftLimit: types.Float64(5000), + RoutingNumber: types.String("021000021"), + Iban: types.String("GB33BUKB20201555555555"), + Bic: types.String("CHASUS33"), + BsbNumber: types.String("062-001"), + BranchIdentifier: types.String("001"), + BankCode: types.String("BNH"), + Country: types.String("US"), + Status: components.AccountingBankAccountStatusActive.ToPointer(), + Description: types.String("Primary operating account for daily transactions"), + CustomFields: []components.CustomField{ + components.CustomField{ + ID: types.String("2389328923893298"), + Name: types.String("employee_level"), + Description: types.String("Employee Level"), + Value: types.Pointer(components.CreateCustomFieldValue2Str( + "Uses Salesforce and Marketo", + )), + }, + }, + CreatedAt: types.MustNewTimeFromString("2020-09-30T07:43:32.000Z"), + UpdatedAt: types.MustNewTimeFromString("2020-09-30T07:43:32.000Z"), + CreatedBy: types.String("12345"), + UpdatedBy: types.String("12345"), + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/src/__tests__/mockserver/internal/handler/pathpatchaccountingbankaccountsid.go b/src/__tests__/mockserver/internal/handler/pathpatchaccountingbankaccountsid.go new file mode 100644 index 00000000..2f8ae4e4 --- /dev/null +++ b/src/__tests__/mockserver/internal/handler/pathpatchaccountingbankaccountsid.go @@ -0,0 +1,77 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPatchAccountingBankAccountsID(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "accounting.bankAccountsUpdate[0]": + dir.HandlerFunc("accounting.bankAccountsUpdate", testAccountingBankAccountsUpdateAccountingBankAccountsUpdate0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testAccountingBankAccountsUpdateAccountingBankAccountsUpdate0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.UpdateBankAccountResponse = &components.UpdateBankAccountResponse{ + StatusCode: 200, + Status: "OK", + Service: types.String("quickbooks"), + Resource: types.String("bank-accounts"), + Operation: types.String("update"), + Data: components.UnifiedID{ + ID: "12345", + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/src/__tests__/mockserver/internal/handler/pathpostaccountingbankaccounts.go b/src/__tests__/mockserver/internal/handler/pathpostaccountingbankaccounts.go new file mode 100644 index 00000000..8ced5fe5 --- /dev/null +++ b/src/__tests__/mockserver/internal/handler/pathpostaccountingbankaccounts.go @@ -0,0 +1,77 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostAccountingBankAccounts(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "accounting.bankAccountsAdd[0]": + dir.HandlerFunc("accounting.bankAccountsAdd", testAccountingBankAccountsAddAccountingBankAccountsAdd0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testAccountingBankAccountsAddAccountingBankAccountsAdd0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.CreateBankAccountResponse = &components.CreateBankAccountResponse{ + StatusCode: 201, + Status: "Created", + Service: types.String("quickbooks"), + Resource: types.String("bank-accounts"), + Operation: types.String("add"), + Data: components.UnifiedID{ + ID: "12345", + }, + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusCreated) + _, _ = w.Write(respBodyBytes) +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/accountingbankaccount.go b/src/__tests__/mockserver/internal/sdk/models/components/accountingbankaccount.go new file mode 100644 index 00000000..34eee2e6 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/accountingbankaccount.go @@ -0,0 +1,490 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" + "time" +) + +// AccountingBankAccountAccountType - The type of bank account +type AccountingBankAccountAccountType string + +const ( + AccountingBankAccountAccountTypeChecking AccountingBankAccountAccountType = "checking" + AccountingBankAccountAccountTypeSavings AccountingBankAccountAccountType = "savings" + AccountingBankAccountAccountTypeCreditCard AccountingBankAccountAccountType = "credit_card" + AccountingBankAccountAccountTypeMoneyMarket AccountingBankAccountAccountType = "money_market" + AccountingBankAccountAccountTypeLineOfCredit AccountingBankAccountAccountType = "line_of_credit" + AccountingBankAccountAccountTypeOther AccountingBankAccountAccountType = "other" +) + +func (e AccountingBankAccountAccountType) ToPointer() *AccountingBankAccountAccountType { + return &e +} +func (e *AccountingBankAccountAccountType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "checking": + fallthrough + case "savings": + fallthrough + case "credit_card": + fallthrough + case "money_market": + fallthrough + case "line_of_credit": + fallthrough + case "other": + *e = AccountingBankAccountAccountType(v) + return nil + default: + return fmt.Errorf("invalid value for AccountingBankAccountAccountType: %v", v) + } +} + +// AccountingBankAccountStatus - The status of the bank account +type AccountingBankAccountStatus string + +const ( + AccountingBankAccountStatusActive AccountingBankAccountStatus = "active" + AccountingBankAccountStatusInactive AccountingBankAccountStatus = "inactive" + AccountingBankAccountStatusClosed AccountingBankAccountStatus = "closed" +) + +func (e AccountingBankAccountStatus) ToPointer() *AccountingBankAccountStatus { + return &e +} +func (e *AccountingBankAccountStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "active": + fallthrough + case "inactive": + fallthrough + case "closed": + *e = AccountingBankAccountStatus(v) + return nil + default: + return fmt.Errorf("invalid value for AccountingBankAccountStatus: %v", v) + } +} + +type AccountingBankAccount struct { + // A unique identifier for an object. + ID string `json:"id"` + // Display ID for the bank account + DisplayID *string `json:"display_id,omitempty"` + // The name of the bank account as it appears in the accounting system + Name *string `json:"name,omitempty"` + // The bank account number + AccountNumber *string `json:"account_number,omitempty"` + // The type of bank account + AccountType *AccountingBankAccountAccountType `json:"account_type,omitempty"` + // The name of the bank or financial institution + BankName *string `json:"bank_name,omitempty"` + // Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + Currency *Currency `json:"currency,omitempty"` + // The current balance of the bank account + Balance *float64 `json:"balance,omitempty"` + // The available balance (considering pending transactions and overdraft) + AvailableBalance *float64 `json:"available_balance,omitempty"` + // The overdraft limit for the account + OverdraftLimit *float64 `json:"overdraft_limit,omitempty"` + // Bank routing number (US) + RoutingNumber *string `json:"routing_number,omitempty"` + // International Bank Account Number + Iban *string `json:"iban,omitempty"` + // Bank Identifier Code / SWIFT Code + Bic *string `json:"bic,omitempty"` + // Bank State Branch number (Australia/New Zealand) + BsbNumber *string `json:"bsb_number,omitempty"` + // Bank branch identifier + BranchIdentifier *string `json:"branch_identifier,omitempty"` + // Bank code assigned by central bank + BankCode *string `json:"bank_code,omitempty"` + // Country code according to ISO 3166-1 alpha-2. + Country *string `json:"country,omitempty"` + // The status of the bank account + Status *AccountingBankAccountStatus `json:"status,omitempty"` + // Description or notes about the bank account + Description *string `json:"description,omitempty"` + CustomFields []CustomField `json:"custom_fields,omitempty"` + // When custom mappings are configured on the resource, the result is included here. + CustomMappings map[string]any `json:"custom_mappings,omitempty"` + // The date and time when the object was created. + CreatedAt *time.Time `json:"created_at,omitempty"` + // The date and time when the object was last updated. + UpdatedAt *time.Time `json:"updated_at,omitempty"` + // The user who created the object. + CreatedBy *string `json:"created_by,omitempty"` + // The user who last updated the object. + UpdatedBy *string `json:"updated_by,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, []string{"id"}); err != nil { + return err + } + return nil +} + +func (o *AccountingBankAccount) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *AccountingBankAccount) GetDisplayID() *string { + if o == nil { + return nil + } + return o.DisplayID +} + +func (o *AccountingBankAccount) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *AccountingBankAccount) GetAccountNumber() *string { + if o == nil { + return nil + } + return o.AccountNumber +} + +func (o *AccountingBankAccount) GetAccountType() *AccountingBankAccountAccountType { + if o == nil { + return nil + } + return o.AccountType +} + +func (o *AccountingBankAccount) GetBankName() *string { + if o == nil { + return nil + } + return o.BankName +} + +func (o *AccountingBankAccount) GetCurrency() *Currency { + if o == nil { + return nil + } + return o.Currency +} + +func (o *AccountingBankAccount) GetBalance() *float64 { + if o == nil { + return nil + } + return o.Balance +} + +func (o *AccountingBankAccount) GetAvailableBalance() *float64 { + if o == nil { + return nil + } + return o.AvailableBalance +} + +func (o *AccountingBankAccount) GetOverdraftLimit() *float64 { + if o == nil { + return nil + } + return o.OverdraftLimit +} + +func (o *AccountingBankAccount) GetRoutingNumber() *string { + if o == nil { + return nil + } + return o.RoutingNumber +} + +func (o *AccountingBankAccount) GetIban() *string { + if o == nil { + return nil + } + return o.Iban +} + +func (o *AccountingBankAccount) GetBic() *string { + if o == nil { + return nil + } + return o.Bic +} + +func (o *AccountingBankAccount) GetBsbNumber() *string { + if o == nil { + return nil + } + return o.BsbNumber +} + +func (o *AccountingBankAccount) GetBranchIdentifier() *string { + if o == nil { + return nil + } + return o.BranchIdentifier +} + +func (o *AccountingBankAccount) GetBankCode() *string { + if o == nil { + return nil + } + return o.BankCode +} + +func (o *AccountingBankAccount) GetCountry() *string { + if o == nil { + return nil + } + return o.Country +} + +func (o *AccountingBankAccount) GetStatus() *AccountingBankAccountStatus { + if o == nil { + return nil + } + return o.Status +} + +func (o *AccountingBankAccount) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *AccountingBankAccount) GetCustomFields() []CustomField { + if o == nil { + return nil + } + return o.CustomFields +} + +func (o *AccountingBankAccount) GetCustomMappings() map[string]any { + if o == nil { + return nil + } + return o.CustomMappings +} + +func (o *AccountingBankAccount) GetCreatedAt() *time.Time { + if o == nil { + return nil + } + return o.CreatedAt +} + +func (o *AccountingBankAccount) GetUpdatedAt() *time.Time { + if o == nil { + return nil + } + return o.UpdatedAt +} + +func (o *AccountingBankAccount) GetCreatedBy() *string { + if o == nil { + return nil + } + return o.CreatedBy +} + +func (o *AccountingBankAccount) GetUpdatedBy() *string { + if o == nil { + return nil + } + return o.UpdatedBy +} + +type AccountingBankAccountInput struct { + // Display ID for the bank account + DisplayID *string `json:"display_id,omitempty"` + // The name of the bank account as it appears in the accounting system + Name *string `json:"name,omitempty"` + // The bank account number + AccountNumber *string `json:"account_number,omitempty"` + // The type of bank account + AccountType *AccountingBankAccountAccountType `json:"account_type,omitempty"` + // The name of the bank or financial institution + BankName *string `json:"bank_name,omitempty"` + // Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + Currency *Currency `json:"currency,omitempty"` + // The current balance of the bank account + Balance *float64 `json:"balance,omitempty"` + // The available balance (considering pending transactions and overdraft) + AvailableBalance *float64 `json:"available_balance,omitempty"` + // The overdraft limit for the account + OverdraftLimit *float64 `json:"overdraft_limit,omitempty"` + // Bank routing number (US) + RoutingNumber *string `json:"routing_number,omitempty"` + // International Bank Account Number + Iban *string `json:"iban,omitempty"` + // Bank Identifier Code / SWIFT Code + Bic *string `json:"bic,omitempty"` + // Bank State Branch number (Australia/New Zealand) + BsbNumber *string `json:"bsb_number,omitempty"` + // Bank branch identifier + BranchIdentifier *string `json:"branch_identifier,omitempty"` + // Bank code assigned by central bank + BankCode *string `json:"bank_code,omitempty"` + // Country code according to ISO 3166-1 alpha-2. + Country *string `json:"country,omitempty"` + // The status of the bank account + Status *AccountingBankAccountStatus `json:"status,omitempty"` + // Description or notes about the bank account + Description *string `json:"description,omitempty"` + CustomFields []CustomField `json:"custom_fields,omitempty"` +} + +func (o *AccountingBankAccountInput) GetDisplayID() *string { + if o == nil { + return nil + } + return o.DisplayID +} + +func (o *AccountingBankAccountInput) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *AccountingBankAccountInput) GetAccountNumber() *string { + if o == nil { + return nil + } + return o.AccountNumber +} + +func (o *AccountingBankAccountInput) GetAccountType() *AccountingBankAccountAccountType { + if o == nil { + return nil + } + return o.AccountType +} + +func (o *AccountingBankAccountInput) GetBankName() *string { + if o == nil { + return nil + } + return o.BankName +} + +func (o *AccountingBankAccountInput) GetCurrency() *Currency { + if o == nil { + return nil + } + return o.Currency +} + +func (o *AccountingBankAccountInput) GetBalance() *float64 { + if o == nil { + return nil + } + return o.Balance +} + +func (o *AccountingBankAccountInput) GetAvailableBalance() *float64 { + if o == nil { + return nil + } + return o.AvailableBalance +} + +func (o *AccountingBankAccountInput) GetOverdraftLimit() *float64 { + if o == nil { + return nil + } + return o.OverdraftLimit +} + +func (o *AccountingBankAccountInput) GetRoutingNumber() *string { + if o == nil { + return nil + } + return o.RoutingNumber +} + +func (o *AccountingBankAccountInput) GetIban() *string { + if o == nil { + return nil + } + return o.Iban +} + +func (o *AccountingBankAccountInput) GetBic() *string { + if o == nil { + return nil + } + return o.Bic +} + +func (o *AccountingBankAccountInput) GetBsbNumber() *string { + if o == nil { + return nil + } + return o.BsbNumber +} + +func (o *AccountingBankAccountInput) GetBranchIdentifier() *string { + if o == nil { + return nil + } + return o.BranchIdentifier +} + +func (o *AccountingBankAccountInput) GetBankCode() *string { + if o == nil { + return nil + } + return o.BankCode +} + +func (o *AccountingBankAccountInput) GetCountry() *string { + if o == nil { + return nil + } + return o.Country +} + +func (o *AccountingBankAccountInput) GetStatus() *AccountingBankAccountStatus { + if o == nil { + return nil + } + return o.Status +} + +func (o *AccountingBankAccountInput) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *AccountingBankAccountInput) GetCustomFields() []CustomField { + if o == nil { + return nil + } + return o.CustomFields +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/bankaccountsfilter.go b/src/__tests__/mockserver/internal/sdk/models/components/bankaccountsfilter.go new file mode 100644 index 00000000..4cb4b40a --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/bankaccountsfilter.go @@ -0,0 +1,59 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// BankAccountsFilterStatus - Filter by account status +type BankAccountsFilterStatus string + +const ( + BankAccountsFilterStatusActive BankAccountsFilterStatus = "active" + BankAccountsFilterStatusInactive BankAccountsFilterStatus = "inactive" + BankAccountsFilterStatusClosed BankAccountsFilterStatus = "closed" +) + +func (e BankAccountsFilterStatus) ToPointer() *BankAccountsFilterStatus { + return &e +} +func (e *BankAccountsFilterStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "active": + fallthrough + case "inactive": + fallthrough + case "closed": + *e = BankAccountsFilterStatus(v) + return nil + default: + return fmt.Errorf("invalid value for BankAccountsFilterStatus: %v", v) + } +} + +type BankAccountsFilter struct { + // Filter by bank account name + Name *string `queryParam:"name=name"` + // Filter by account status + Status *BankAccountsFilterStatus `queryParam:"name=status"` +} + +func (o *BankAccountsFilter) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *BankAccountsFilter) GetStatus() *BankAccountsFilterStatus { + if o == nil { + return nil + } + return o.Status +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/bankaccountssort.go b/src/__tests__/mockserver/internal/sdk/models/components/bankaccountssort.go new file mode 100644 index 00000000..3a4f1dd5 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/bankaccountssort.go @@ -0,0 +1,68 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" +) + +// SortBy - The field to sort by +type SortBy string + +const ( + SortByCreatedAt SortBy = "created_at" + SortByUpdatedAt SortBy = "updated_at" +) + +func (e SortBy) ToPointer() *SortBy { + return &e +} +func (e *SortBy) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "created_at": + fallthrough + case "updated_at": + *e = SortBy(v) + return nil + default: + return fmt.Errorf("invalid value for SortBy: %v", v) + } +} + +type BankAccountsSort struct { + // The field to sort by + By *SortBy `default:"updated_at" queryParam:"name=by"` + // The direction in which to sort the results + Direction *SortDirection `default:"asc" queryParam:"name=direction"` +} + +func (b BankAccountsSort) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(b, "", false) +} + +func (b *BankAccountsSort) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &b, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *BankAccountsSort) GetBy() *SortBy { + if o == nil { + return nil + } + return o.By +} + +func (o *BankAccountsSort) GetDirection() *SortDirection { + if o == nil { + return nil + } + return o.Direction +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/createbankaccountresponse.go b/src/__tests__/mockserver/internal/sdk/models/components/createbankaccountresponse.go new file mode 100644 index 00000000..5d59f1f4 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/createbankaccountresponse.go @@ -0,0 +1,61 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// CreateBankAccountResponse - Bank Account created +type CreateBankAccountResponse struct { + // HTTP Response Status Code + StatusCode int64 `json:"status_code"` + // HTTP Response Status + Status string `json:"status"` + // Apideck ID of service provider + Service *string `json:"service,omitempty"` + // Unified API resource name + Resource *string `json:"resource,omitempty"` + // Operation performed + Operation *string `json:"operation,omitempty"` + // A object containing a unique identifier for the resource that was created, updated, or deleted. + Data UnifiedID `json:"data"` +} + +func (o *CreateBankAccountResponse) GetStatusCode() int64 { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CreateBankAccountResponse) GetStatus() string { + if o == nil { + return "" + } + return o.Status +} + +func (o *CreateBankAccountResponse) GetService() *string { + if o == nil { + return nil + } + return o.Service +} + +func (o *CreateBankAccountResponse) GetResource() *string { + if o == nil { + return nil + } + return o.Resource +} + +func (o *CreateBankAccountResponse) GetOperation() *string { + if o == nil { + return nil + } + return o.Operation +} + +func (o *CreateBankAccountResponse) GetData() UnifiedID { + if o == nil { + return UnifiedID{} + } + return o.Data +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/deletebankaccountresponse.go b/src/__tests__/mockserver/internal/sdk/models/components/deletebankaccountresponse.go new file mode 100644 index 00000000..c044950b --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/deletebankaccountresponse.go @@ -0,0 +1,61 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DeleteBankAccountResponse - Bank Account deleted +type DeleteBankAccountResponse struct { + // HTTP Response Status Code + StatusCode int64 `json:"status_code"` + // HTTP Response Status + Status string `json:"status"` + // Apideck ID of service provider + Service *string `json:"service,omitempty"` + // Unified API resource name + Resource *string `json:"resource,omitempty"` + // Operation performed + Operation *string `json:"operation,omitempty"` + // A object containing a unique identifier for the resource that was created, updated, or deleted. + Data UnifiedID `json:"data"` +} + +func (o *DeleteBankAccountResponse) GetStatusCode() int64 { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *DeleteBankAccountResponse) GetStatus() string { + if o == nil { + return "" + } + return o.Status +} + +func (o *DeleteBankAccountResponse) GetService() *string { + if o == nil { + return nil + } + return o.Service +} + +func (o *DeleteBankAccountResponse) GetResource() *string { + if o == nil { + return nil + } + return o.Resource +} + +func (o *DeleteBankAccountResponse) GetOperation() *string { + if o == nil { + return nil + } + return o.Operation +} + +func (o *DeleteBankAccountResponse) GetData() UnifiedID { + if o == nil { + return UnifiedID{} + } + return o.Data +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/getbankaccountresponse.go b/src/__tests__/mockserver/internal/sdk/models/components/getbankaccountresponse.go new file mode 100644 index 00000000..c4b36bb1 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/getbankaccountresponse.go @@ -0,0 +1,60 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// GetBankAccountResponse - Bank Account +type GetBankAccountResponse struct { + // HTTP Response Status Code + StatusCode int64 `json:"status_code"` + // HTTP Response Status + Status string `json:"status"` + // Apideck ID of service provider + Service *string `json:"service,omitempty"` + // Unified API resource name + Resource *string `json:"resource,omitempty"` + // Operation performed + Operation *string `json:"operation,omitempty"` + Data AccountingBankAccount `json:"data"` +} + +func (o *GetBankAccountResponse) GetStatusCode() int64 { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetBankAccountResponse) GetStatus() string { + if o == nil { + return "" + } + return o.Status +} + +func (o *GetBankAccountResponse) GetService() *string { + if o == nil { + return nil + } + return o.Service +} + +func (o *GetBankAccountResponse) GetResource() *string { + if o == nil { + return nil + } + return o.Resource +} + +func (o *GetBankAccountResponse) GetOperation() *string { + if o == nil { + return nil + } + return o.Operation +} + +func (o *GetBankAccountResponse) GetData() AccountingBankAccount { + if o == nil { + return AccountingBankAccount{} + } + return o.Data +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/getbankaccountsresponse.go b/src/__tests__/mockserver/internal/sdk/models/components/getbankaccountsresponse.go new file mode 100644 index 00000000..df86bac9 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/getbankaccountsresponse.go @@ -0,0 +1,78 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// GetBankAccountsResponse - Bank Accounts +type GetBankAccountsResponse struct { + // HTTP Response Status Code + StatusCode int64 `json:"status_code"` + // HTTP Response Status + Status string `json:"status"` + // Apideck ID of service provider + Service *string `json:"service,omitempty"` + // Unified API resource name + Resource *string `json:"resource,omitempty"` + // Operation performed + Operation *string `json:"operation,omitempty"` + Data []AccountingBankAccount `json:"data"` + // Response metadata + Meta *Meta `json:"meta,omitempty"` + // Links to navigate to previous or next pages through the API + Links *Links `json:"links,omitempty"` +} + +func (o *GetBankAccountsResponse) GetStatusCode() int64 { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetBankAccountsResponse) GetStatus() string { + if o == nil { + return "" + } + return o.Status +} + +func (o *GetBankAccountsResponse) GetService() *string { + if o == nil { + return nil + } + return o.Service +} + +func (o *GetBankAccountsResponse) GetResource() *string { + if o == nil { + return nil + } + return o.Resource +} + +func (o *GetBankAccountsResponse) GetOperation() *string { + if o == nil { + return nil + } + return o.Operation +} + +func (o *GetBankAccountsResponse) GetData() []AccountingBankAccount { + if o == nil { + return []AccountingBankAccount{} + } + return o.Data +} + +func (o *GetBankAccountsResponse) GetMeta() *Meta { + if o == nil { + return nil + } + return o.Meta +} + +func (o *GetBankAccountsResponse) GetLinks() *Links { + if o == nil { + return nil + } + return o.Links +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/logsfilter.go b/src/__tests__/mockserver/internal/sdk/models/components/logsfilter.go index d400063d..520a3990 100644 --- a/src/__tests__/mockserver/internal/sdk/models/components/logsfilter.go +++ b/src/__tests__/mockserver/internal/sdk/models/components/logsfilter.go @@ -3,9 +3,12 @@ package components type LogsFilter struct { - ConnectorID *string `queryParam:"name=connector_id"` - StatusCode *float64 `queryParam:"name=status_code"` - ExcludeUnifiedApis *string `queryParam:"name=exclude_unified_apis"` + ConnectorID *string `queryParam:"name=connector_id"` + // Filter by a single HTTP status code. For backward compatibility - use status_codes for multiple values. + StatusCode *float64 `queryParam:"name=status_code"` + // Filter by multiple HTTP status codes. Values must be between 100-599. Maximum 50 status codes allowed. + StatusCodes []float64 `queryParam:"name=status_codes"` + ExcludeUnifiedApis *string `queryParam:"name=exclude_unified_apis"` } func (o *LogsFilter) GetConnectorID() *string { @@ -22,6 +25,13 @@ func (o *LogsFilter) GetStatusCode() *float64 { return o.StatusCode } +func (o *LogsFilter) GetStatusCodes() []float64 { + if o == nil { + return nil + } + return o.StatusCodes +} + func (o *LogsFilter) GetExcludeUnifiedApis() *string { if o == nil { return nil diff --git a/src/__tests__/mockserver/internal/sdk/models/components/updatebankaccountresponse.go b/src/__tests__/mockserver/internal/sdk/models/components/updatebankaccountresponse.go new file mode 100644 index 00000000..a9dbc4f8 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/updatebankaccountresponse.go @@ -0,0 +1,61 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// UpdateBankAccountResponse - Bank Account updated +type UpdateBankAccountResponse struct { + // HTTP Response Status Code + StatusCode int64 `json:"status_code"` + // HTTP Response Status + Status string `json:"status"` + // Apideck ID of service provider + Service *string `json:"service,omitempty"` + // Unified API resource name + Resource *string `json:"resource,omitempty"` + // Operation performed + Operation *string `json:"operation,omitempty"` + // A object containing a unique identifier for the resource that was created, updated, or deleted. + Data UnifiedID `json:"data"` +} + +func (o *UpdateBankAccountResponse) GetStatusCode() int64 { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *UpdateBankAccountResponse) GetStatus() string { + if o == nil { + return "" + } + return o.Status +} + +func (o *UpdateBankAccountResponse) GetService() *string { + if o == nil { + return nil + } + return o.Service +} + +func (o *UpdateBankAccountResponse) GetResource() *string { + if o == nil { + return nil + } + return o.Resource +} + +func (o *UpdateBankAccountResponse) GetOperation() *string { + if o == nil { + return nil + } + return o.Operation +} + +func (o *UpdateBankAccountResponse) GetData() UnifiedID { + if o == nil { + return UnifiedID{} + } + return o.Data +} diff --git a/src/__tests__/mockserver/internal/sdk/models/operations/accountingbankaccountsadd.go b/src/__tests__/mockserver/internal/sdk/models/operations/accountingbankaccountsadd.go new file mode 100644 index 00000000..a3c90fce --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/operations/accountingbankaccountsadd.go @@ -0,0 +1,116 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" +) + +type AccountingBankAccountsAddGlobals struct { + // ID of the consumer which you want to get or push data from + ConsumerID *string `header:"style=simple,explode=false,name=x-apideck-consumer-id"` + // The ID of your Unify application + AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` +} + +func (o *AccountingBankAccountsAddGlobals) GetConsumerID() *string { + if o == nil { + return nil + } + return o.ConsumerID +} + +func (o *AccountingBankAccountsAddGlobals) GetAppID() *string { + if o == nil { + return nil + } + return o.AppID +} + +type AccountingBankAccountsAddRequest struct { + // Include raw response. Mostly used for debugging purposes + Raw *bool `default:"false" queryParam:"style=form,explode=true,name=raw"` + // ID of the consumer which you want to get or push data from + ConsumerID *string `header:"style=simple,explode=false,name=x-apideck-consumer-id"` + // The ID of your Unify application + AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` + // Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + ServiceID *string `header:"style=simple,explode=false,name=x-apideck-service-id"` + AccountingBankAccount components.AccountingBankAccountInput `request:"mediaType=application/json"` +} + +func (a AccountingBankAccountsAddRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountingBankAccountsAddRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, []string{"AccountingBankAccount"}); err != nil { + return err + } + return nil +} + +func (o *AccountingBankAccountsAddRequest) GetRaw() *bool { + if o == nil { + return nil + } + return o.Raw +} + +func (o *AccountingBankAccountsAddRequest) GetConsumerID() *string { + if o == nil { + return nil + } + return o.ConsumerID +} + +func (o *AccountingBankAccountsAddRequest) GetAppID() *string { + if o == nil { + return nil + } + return o.AppID +} + +func (o *AccountingBankAccountsAddRequest) GetServiceID() *string { + if o == nil { + return nil + } + return o.ServiceID +} + +func (o *AccountingBankAccountsAddRequest) GetAccountingBankAccount() components.AccountingBankAccountInput { + if o == nil { + return components.AccountingBankAccountInput{} + } + return o.AccountingBankAccount +} + +type AccountingBankAccountsAddResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Bank Account created + CreateBankAccountResponse *components.CreateBankAccountResponse + // Unexpected error + UnexpectedErrorResponse *components.UnexpectedErrorResponse +} + +func (o *AccountingBankAccountsAddResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *AccountingBankAccountsAddResponse) GetCreateBankAccountResponse() *components.CreateBankAccountResponse { + if o == nil { + return nil + } + return o.CreateBankAccountResponse +} + +func (o *AccountingBankAccountsAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { + if o == nil { + return nil + } + return o.UnexpectedErrorResponse +} diff --git a/src/__tests__/mockserver/internal/sdk/models/operations/accountingbankaccountsall.go b/src/__tests__/mockserver/internal/sdk/models/operations/accountingbankaccountsall.go new file mode 100644 index 00000000..ddb9410c --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/operations/accountingbankaccountsall.go @@ -0,0 +1,164 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" +) + +type AccountingBankAccountsAllGlobals struct { + // ID of the consumer which you want to get or push data from + ConsumerID *string `header:"style=simple,explode=false,name=x-apideck-consumer-id"` + // The ID of your Unify application + AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` +} + +func (o *AccountingBankAccountsAllGlobals) GetConsumerID() *string { + if o == nil { + return nil + } + return o.ConsumerID +} + +func (o *AccountingBankAccountsAllGlobals) GetAppID() *string { + if o == nil { + return nil + } + return o.AppID +} + +type AccountingBankAccountsAllRequest struct { + // Include raw response. Mostly used for debugging purposes + Raw *bool `default:"false" queryParam:"style=form,explode=true,name=raw"` + // ID of the consumer which you want to get or push data from + ConsumerID *string `header:"style=simple,explode=false,name=x-apideck-consumer-id"` + // The ID of your Unify application + AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` + // Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + ServiceID *string `header:"style=simple,explode=false,name=x-apideck-service-id"` + // Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + Cursor *string `queryParam:"style=form,explode=true,name=cursor"` + // Number of results to return. Minimum 1, Maximum 200, Default 20 + Limit *int64 `default:"20" queryParam:"style=form,explode=true,name=limit"` + // Apply filters + Filter *components.BankAccountsFilter `queryParam:"style=deepObject,explode=true,name=filter"` + // Apply sorting + Sort *components.BankAccountsSort `queryParam:"style=deepObject,explode=true,name=sort"` + // Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + PassThrough map[string]any `queryParam:"style=deepObject,explode=true,name=pass_through"` + // The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. + Fields *string `queryParam:"style=form,explode=true,name=fields"` +} + +func (a AccountingBankAccountsAllRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountingBankAccountsAllRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *AccountingBankAccountsAllRequest) GetRaw() *bool { + if o == nil { + return nil + } + return o.Raw +} + +func (o *AccountingBankAccountsAllRequest) GetConsumerID() *string { + if o == nil { + return nil + } + return o.ConsumerID +} + +func (o *AccountingBankAccountsAllRequest) GetAppID() *string { + if o == nil { + return nil + } + return o.AppID +} + +func (o *AccountingBankAccountsAllRequest) GetServiceID() *string { + if o == nil { + return nil + } + return o.ServiceID +} + +func (o *AccountingBankAccountsAllRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *AccountingBankAccountsAllRequest) GetLimit() *int64 { + if o == nil { + return nil + } + return o.Limit +} + +func (o *AccountingBankAccountsAllRequest) GetFilter() *components.BankAccountsFilter { + if o == nil { + return nil + } + return o.Filter +} + +func (o *AccountingBankAccountsAllRequest) GetSort() *components.BankAccountsSort { + if o == nil { + return nil + } + return o.Sort +} + +func (o *AccountingBankAccountsAllRequest) GetPassThrough() map[string]any { + if o == nil { + return nil + } + return o.PassThrough +} + +func (o *AccountingBankAccountsAllRequest) GetFields() *string { + if o == nil { + return nil + } + return o.Fields +} + +type AccountingBankAccountsAllResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Bank Accounts + GetBankAccountsResponse *components.GetBankAccountsResponse + // Unexpected error + UnexpectedErrorResponse *components.UnexpectedErrorResponse + + Next func() (*AccountingBankAccountsAllResponse, error) +} + +func (o *AccountingBankAccountsAllResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *AccountingBankAccountsAllResponse) GetGetBankAccountsResponse() *components.GetBankAccountsResponse { + if o == nil { + return nil + } + return o.GetBankAccountsResponse +} + +func (o *AccountingBankAccountsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { + if o == nil { + return nil + } + return o.UnexpectedErrorResponse +} diff --git a/src/__tests__/mockserver/internal/sdk/models/operations/accountingbankaccountsdelete.go b/src/__tests__/mockserver/internal/sdk/models/operations/accountingbankaccountsdelete.go new file mode 100644 index 00000000..0eecfa51 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/operations/accountingbankaccountsdelete.go @@ -0,0 +1,117 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" +) + +type AccountingBankAccountsDeleteGlobals struct { + // ID of the consumer which you want to get or push data from + ConsumerID *string `header:"style=simple,explode=false,name=x-apideck-consumer-id"` + // The ID of your Unify application + AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` +} + +func (o *AccountingBankAccountsDeleteGlobals) GetConsumerID() *string { + if o == nil { + return nil + } + return o.ConsumerID +} + +func (o *AccountingBankAccountsDeleteGlobals) GetAppID() *string { + if o == nil { + return nil + } + return o.AppID +} + +type AccountingBankAccountsDeleteRequest struct { + // ID of the record you are acting upon. + ID string `pathParam:"style=simple,explode=false,name=id"` + // ID of the consumer which you want to get or push data from + ConsumerID *string `header:"style=simple,explode=false,name=x-apideck-consumer-id"` + // The ID of your Unify application + AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` + // Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + ServiceID *string `header:"style=simple,explode=false,name=x-apideck-service-id"` + // Include raw response. Mostly used for debugging purposes + Raw *bool `default:"false" queryParam:"style=form,explode=true,name=raw"` +} + +func (a AccountingBankAccountsDeleteRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountingBankAccountsDeleteRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, []string{"id"}); err != nil { + return err + } + return nil +} + +func (o *AccountingBankAccountsDeleteRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *AccountingBankAccountsDeleteRequest) GetConsumerID() *string { + if o == nil { + return nil + } + return o.ConsumerID +} + +func (o *AccountingBankAccountsDeleteRequest) GetAppID() *string { + if o == nil { + return nil + } + return o.AppID +} + +func (o *AccountingBankAccountsDeleteRequest) GetServiceID() *string { + if o == nil { + return nil + } + return o.ServiceID +} + +func (o *AccountingBankAccountsDeleteRequest) GetRaw() *bool { + if o == nil { + return nil + } + return o.Raw +} + +type AccountingBankAccountsDeleteResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Bank Account deleted + DeleteBankAccountResponse *components.DeleteBankAccountResponse + // Unexpected error + UnexpectedErrorResponse *components.UnexpectedErrorResponse +} + +func (o *AccountingBankAccountsDeleteResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *AccountingBankAccountsDeleteResponse) GetDeleteBankAccountResponse() *components.DeleteBankAccountResponse { + if o == nil { + return nil + } + return o.DeleteBankAccountResponse +} + +func (o *AccountingBankAccountsDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { + if o == nil { + return nil + } + return o.UnexpectedErrorResponse +} diff --git a/src/__tests__/mockserver/internal/sdk/models/operations/accountingbankaccountsone.go b/src/__tests__/mockserver/internal/sdk/models/operations/accountingbankaccountsone.go new file mode 100644 index 00000000..2269e73a --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/operations/accountingbankaccountsone.go @@ -0,0 +1,126 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" +) + +type AccountingBankAccountsOneGlobals struct { + // ID of the consumer which you want to get or push data from + ConsumerID *string `header:"style=simple,explode=false,name=x-apideck-consumer-id"` + // The ID of your Unify application + AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` +} + +func (o *AccountingBankAccountsOneGlobals) GetConsumerID() *string { + if o == nil { + return nil + } + return o.ConsumerID +} + +func (o *AccountingBankAccountsOneGlobals) GetAppID() *string { + if o == nil { + return nil + } + return o.AppID +} + +type AccountingBankAccountsOneRequest struct { + // ID of the record you are acting upon. + ID string `pathParam:"style=simple,explode=false,name=id"` + // ID of the consumer which you want to get or push data from + ConsumerID *string `header:"style=simple,explode=false,name=x-apideck-consumer-id"` + // The ID of your Unify application + AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` + // Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + ServiceID *string `header:"style=simple,explode=false,name=x-apideck-service-id"` + // Include raw response. Mostly used for debugging purposes + Raw *bool `default:"false" queryParam:"style=form,explode=true,name=raw"` + // The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. + Fields *string `queryParam:"style=form,explode=true,name=fields"` +} + +func (a AccountingBankAccountsOneRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountingBankAccountsOneRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, []string{"id"}); err != nil { + return err + } + return nil +} + +func (o *AccountingBankAccountsOneRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *AccountingBankAccountsOneRequest) GetConsumerID() *string { + if o == nil { + return nil + } + return o.ConsumerID +} + +func (o *AccountingBankAccountsOneRequest) GetAppID() *string { + if o == nil { + return nil + } + return o.AppID +} + +func (o *AccountingBankAccountsOneRequest) GetServiceID() *string { + if o == nil { + return nil + } + return o.ServiceID +} + +func (o *AccountingBankAccountsOneRequest) GetRaw() *bool { + if o == nil { + return nil + } + return o.Raw +} + +func (o *AccountingBankAccountsOneRequest) GetFields() *string { + if o == nil { + return nil + } + return o.Fields +} + +type AccountingBankAccountsOneResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Bank Account + GetBankAccountResponse *components.GetBankAccountResponse + // Unexpected error + UnexpectedErrorResponse *components.UnexpectedErrorResponse +} + +func (o *AccountingBankAccountsOneResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *AccountingBankAccountsOneResponse) GetGetBankAccountResponse() *components.GetBankAccountResponse { + if o == nil { + return nil + } + return o.GetBankAccountResponse +} + +func (o *AccountingBankAccountsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { + if o == nil { + return nil + } + return o.UnexpectedErrorResponse +} diff --git a/src/__tests__/mockserver/internal/sdk/models/operations/accountingbankaccountsupdate.go b/src/__tests__/mockserver/internal/sdk/models/operations/accountingbankaccountsupdate.go new file mode 100644 index 00000000..f3782633 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/operations/accountingbankaccountsupdate.go @@ -0,0 +1,125 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" +) + +type AccountingBankAccountsUpdateGlobals struct { + // ID of the consumer which you want to get or push data from + ConsumerID *string `header:"style=simple,explode=false,name=x-apideck-consumer-id"` + // The ID of your Unify application + AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` +} + +func (o *AccountingBankAccountsUpdateGlobals) GetConsumerID() *string { + if o == nil { + return nil + } + return o.ConsumerID +} + +func (o *AccountingBankAccountsUpdateGlobals) GetAppID() *string { + if o == nil { + return nil + } + return o.AppID +} + +type AccountingBankAccountsUpdateRequest struct { + // ID of the record you are acting upon. + ID string `pathParam:"style=simple,explode=false,name=id"` + // ID of the consumer which you want to get or push data from + ConsumerID *string `header:"style=simple,explode=false,name=x-apideck-consumer-id"` + // The ID of your Unify application + AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` + // Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + ServiceID *string `header:"style=simple,explode=false,name=x-apideck-service-id"` + // Include raw response. Mostly used for debugging purposes + Raw *bool `default:"false" queryParam:"style=form,explode=true,name=raw"` + AccountingBankAccount components.AccountingBankAccountInput `request:"mediaType=application/json"` +} + +func (a AccountingBankAccountsUpdateRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AccountingBankAccountsUpdateRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, []string{"id", "AccountingBankAccount"}); err != nil { + return err + } + return nil +} + +func (o *AccountingBankAccountsUpdateRequest) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *AccountingBankAccountsUpdateRequest) GetConsumerID() *string { + if o == nil { + return nil + } + return o.ConsumerID +} + +func (o *AccountingBankAccountsUpdateRequest) GetAppID() *string { + if o == nil { + return nil + } + return o.AppID +} + +func (o *AccountingBankAccountsUpdateRequest) GetServiceID() *string { + if o == nil { + return nil + } + return o.ServiceID +} + +func (o *AccountingBankAccountsUpdateRequest) GetRaw() *bool { + if o == nil { + return nil + } + return o.Raw +} + +func (o *AccountingBankAccountsUpdateRequest) GetAccountingBankAccount() components.AccountingBankAccountInput { + if o == nil { + return components.AccountingBankAccountInput{} + } + return o.AccountingBankAccount +} + +type AccountingBankAccountsUpdateResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Bank Account updated + UpdateBankAccountResponse *components.UpdateBankAccountResponse + // Unexpected error + UnexpectedErrorResponse *components.UnexpectedErrorResponse +} + +func (o *AccountingBankAccountsUpdateResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *AccountingBankAccountsUpdateResponse) GetUpdateBankAccountResponse() *components.UpdateBankAccountResponse { + if o == nil { + return nil + } + return o.UpdateBankAccountResponse +} + +func (o *AccountingBankAccountsUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { + if o == nil { + return nil + } + return o.UnexpectedErrorResponse +} diff --git a/src/funcs/accountingBankAccountsCreate.ts b/src/funcs/accountingBankAccountsCreate.ts new file mode 100644 index 00000000..f58d68e7 --- /dev/null +++ b/src/funcs/accountingBankAccountsCreate.ts @@ -0,0 +1,225 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ApideckCore } from "../core.js"; +import { encodeFormQuery, encodeJSON, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { ApideckError } from "../models/errors/apideckerror.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Create Bank Account + * + * @remarks + * Create Bank Account + */ +export function accountingBankAccountsCreate( + client: ApideckCore, + request: operations.AccountingBankAccountsAddRequest, + options?: RequestOptions, +): APIPromise< + Result< + operations.AccountingBankAccountsAddResponse, + | errors.BadRequestResponse + | errors.UnauthorizedResponse + | errors.PaymentRequiredResponse + | errors.NotFoundResponse + | errors.UnprocessableResponse + | ApideckError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: ApideckCore, + request: operations.AccountingBankAccountsAddRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.AccountingBankAccountsAddResponse, + | errors.BadRequestResponse + | errors.UnauthorizedResponse + | errors.PaymentRequiredResponse + | errors.NotFoundResponse + | errors.UnprocessableResponse + | ApideckError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.AccountingBankAccountsAddRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload.AccountingBankAccount, { + explode: true, + }); + + const path = pathToFunc("/accounting/bank-accounts")(); + + const query = encodeFormQuery({ + "raw": payload.raw, + }); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + "x-apideck-app-id": encodeSimple( + "x-apideck-app-id", + payload.appId ?? client._options.appId, + { explode: false, charEncoding: "none" }, + ), + "x-apideck-consumer-id": encodeSimple( + "x-apideck-consumer-id", + payload.consumerId ?? client._options.consumerId, + { explode: false, charEncoding: "none" }, + ), + "x-apideck-service-id": encodeSimple( + "x-apideck-service-id", + payload.serviceId, + { explode: false, charEncoding: "none" }, + ), + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "accounting.bankAccountsAdd", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["408", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "402", "404", "422", "4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.AccountingBankAccountsAddResponse, + | errors.BadRequestResponse + | errors.UnauthorizedResponse + | errors.PaymentRequiredResponse + | errors.NotFoundResponse + | errors.UnprocessableResponse + | ApideckError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(201, operations.AccountingBankAccountsAddResponse$inboundSchema, { + key: "CreateBankAccountResponse", + }), + M.jsonErr(400, errors.BadRequestResponse$inboundSchema), + M.jsonErr(401, errors.UnauthorizedResponse$inboundSchema), + M.jsonErr(402, errors.PaymentRequiredResponse$inboundSchema), + M.jsonErr(404, errors.NotFoundResponse$inboundSchema), + M.jsonErr(422, errors.UnprocessableResponse$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + M.json( + "default", + operations.AccountingBankAccountsAddResponse$inboundSchema, + { key: "UnexpectedErrorResponse" }, + ), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/accountingBankAccountsDelete.ts b/src/funcs/accountingBankAccountsDelete.ts new file mode 100644 index 00000000..91f39cb1 --- /dev/null +++ b/src/funcs/accountingBankAccountsDelete.ts @@ -0,0 +1,231 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ApideckCore } from "../core.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { ApideckError } from "../models/errors/apideckerror.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Delete Bank Account + * + * @remarks + * Delete Bank Account + */ +export function accountingBankAccountsDelete( + client: ApideckCore, + request: operations.AccountingBankAccountsDeleteRequest, + options?: RequestOptions, +): APIPromise< + Result< + operations.AccountingBankAccountsDeleteResponse, + | errors.BadRequestResponse + | errors.UnauthorizedResponse + | errors.PaymentRequiredResponse + | errors.NotFoundResponse + | errors.UnprocessableResponse + | ApideckError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: ApideckCore, + request: operations.AccountingBankAccountsDeleteRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.AccountingBankAccountsDeleteResponse, + | errors.BadRequestResponse + | errors.UnauthorizedResponse + | errors.PaymentRequiredResponse + | errors.NotFoundResponse + | errors.UnprocessableResponse + | ApideckError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.AccountingBankAccountsDeleteRequest$outboundSchema.parse( + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc("/accounting/bank-accounts/{id}")(pathParams); + + const query = encodeFormQuery({ + "raw": payload.raw, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + "x-apideck-app-id": encodeSimple( + "x-apideck-app-id", + payload.appId ?? client._options.appId, + { explode: false, charEncoding: "none" }, + ), + "x-apideck-consumer-id": encodeSimple( + "x-apideck-consumer-id", + payload.consumerId ?? client._options.consumerId, + { explode: false, charEncoding: "none" }, + ), + "x-apideck-service-id": encodeSimple( + "x-apideck-service-id", + payload.serviceId, + { explode: false, charEncoding: "none" }, + ), + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "accounting.bankAccountsDelete", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["408", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "DELETE", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "402", "404", "422", "4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.AccountingBankAccountsDeleteResponse, + | errors.BadRequestResponse + | errors.UnauthorizedResponse + | errors.PaymentRequiredResponse + | errors.NotFoundResponse + | errors.UnprocessableResponse + | ApideckError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.AccountingBankAccountsDeleteResponse$inboundSchema, { + key: "DeleteBankAccountResponse", + }), + M.jsonErr(400, errors.BadRequestResponse$inboundSchema), + M.jsonErr(401, errors.UnauthorizedResponse$inboundSchema), + M.jsonErr(402, errors.PaymentRequiredResponse$inboundSchema), + M.jsonErr(404, errors.NotFoundResponse$inboundSchema), + M.jsonErr(422, errors.UnprocessableResponse$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + M.json( + "default", + operations.AccountingBankAccountsDeleteResponse$inboundSchema, + { key: "UnexpectedErrorResponse" }, + ), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/accountingBankAccountsGet.ts b/src/funcs/accountingBankAccountsGet.ts new file mode 100644 index 00000000..a200c209 --- /dev/null +++ b/src/funcs/accountingBankAccountsGet.ts @@ -0,0 +1,230 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ApideckCore } from "../core.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { ApideckError } from "../models/errors/apideckerror.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Get Bank Account + * + * @remarks + * Get Bank Account + */ +export function accountingBankAccountsGet( + client: ApideckCore, + request: operations.AccountingBankAccountsOneRequest, + options?: RequestOptions, +): APIPromise< + Result< + operations.AccountingBankAccountsOneResponse, + | errors.BadRequestResponse + | errors.UnauthorizedResponse + | errors.PaymentRequiredResponse + | errors.NotFoundResponse + | errors.UnprocessableResponse + | ApideckError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: ApideckCore, + request: operations.AccountingBankAccountsOneRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.AccountingBankAccountsOneResponse, + | errors.BadRequestResponse + | errors.UnauthorizedResponse + | errors.PaymentRequiredResponse + | errors.NotFoundResponse + | errors.UnprocessableResponse + | ApideckError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.AccountingBankAccountsOneRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc("/accounting/bank-accounts/{id}")(pathParams); + + const query = encodeFormQuery({ + "fields": payload.fields, + "raw": payload.raw, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + "x-apideck-app-id": encodeSimple( + "x-apideck-app-id", + payload.appId ?? client._options.appId, + { explode: false, charEncoding: "none" }, + ), + "x-apideck-consumer-id": encodeSimple( + "x-apideck-consumer-id", + payload.consumerId ?? client._options.consumerId, + { explode: false, charEncoding: "none" }, + ), + "x-apideck-service-id": encodeSimple( + "x-apideck-service-id", + payload.serviceId, + { explode: false, charEncoding: "none" }, + ), + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "accounting.bankAccountsOne", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["408", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "402", "404", "422", "4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.AccountingBankAccountsOneResponse, + | errors.BadRequestResponse + | errors.UnauthorizedResponse + | errors.PaymentRequiredResponse + | errors.NotFoundResponse + | errors.UnprocessableResponse + | ApideckError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.AccountingBankAccountsOneResponse$inboundSchema, { + key: "GetBankAccountResponse", + }), + M.jsonErr(400, errors.BadRequestResponse$inboundSchema), + M.jsonErr(401, errors.UnauthorizedResponse$inboundSchema), + M.jsonErr(402, errors.PaymentRequiredResponse$inboundSchema), + M.jsonErr(404, errors.NotFoundResponse$inboundSchema), + M.jsonErr(422, errors.UnprocessableResponse$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + M.json( + "default", + operations.AccountingBankAccountsOneResponse$inboundSchema, + { key: "UnexpectedErrorResponse" }, + ), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/accountingBankAccountsList.ts b/src/funcs/accountingBankAccountsList.ts new file mode 100644 index 00000000..af65ab39 --- /dev/null +++ b/src/funcs/accountingBankAccountsList.ts @@ -0,0 +1,303 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ApideckCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeDeepObjectQuery, + encodeFormQuery, + encodeSimple, + queryJoin, +} from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { ApideckError } from "../models/errors/apideckerror.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; +import { + createPageIterator, + haltIterator, + PageIterator, + Paginator, +} from "../types/operations.js"; + +/** + * List Bank Accounts + * + * @remarks + * List Bank Accounts + */ +export function accountingBankAccountsList( + client: ApideckCore, + request: operations.AccountingBankAccountsAllRequest, + options?: RequestOptions, +): APIPromise< + PageIterator< + Result< + operations.AccountingBankAccountsAllResponse, + | errors.BadRequestResponse + | errors.UnauthorizedResponse + | errors.PaymentRequiredResponse + | errors.NotFoundResponse + | errors.UnprocessableResponse + | ApideckError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + { cursor: string } + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: ApideckCore, + request: operations.AccountingBankAccountsAllRequest, + options?: RequestOptions, +): Promise< + [ + PageIterator< + Result< + operations.AccountingBankAccountsAllResponse, + | errors.BadRequestResponse + | errors.UnauthorizedResponse + | errors.PaymentRequiredResponse + | errors.NotFoundResponse + | errors.UnprocessableResponse + | ApideckError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + { cursor: string } + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.AccountingBankAccountsAllRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [haltIterator(parsed), { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const path = pathToFunc("/accounting/bank-accounts")(); + + const query = queryJoin( + encodeDeepObjectQuery({ + "filter": payload.filter, + "pass_through": payload.pass_through, + "sort": payload.sort, + }), + encodeFormQuery({ + "cursor": payload.cursor, + "fields": payload.fields, + "limit": payload.limit, + "raw": payload.raw, + }), + ); + + const headers = new Headers(compactMap({ + Accept: "application/json", + "x-apideck-app-id": encodeSimple( + "x-apideck-app-id", + payload.appId ?? client._options.appId, + { explode: false, charEncoding: "none" }, + ), + "x-apideck-consumer-id": encodeSimple( + "x-apideck-consumer-id", + payload.consumerId ?? client._options.consumerId, + { explode: false, charEncoding: "none" }, + ), + "x-apideck-service-id": encodeSimple( + "x-apideck-service-id", + payload.serviceId, + { explode: false, charEncoding: "none" }, + ), + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "accounting.bankAccountsAll", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["408", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [haltIterator(requestRes), { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "402", "404", "422", "4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [haltIterator(doResult), { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result, raw] = await M.match< + operations.AccountingBankAccountsAllResponse, + | errors.BadRequestResponse + | errors.UnauthorizedResponse + | errors.PaymentRequiredResponse + | errors.NotFoundResponse + | errors.UnprocessableResponse + | ApideckError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.AccountingBankAccountsAllResponse$inboundSchema, { + key: "GetBankAccountsResponse", + }), + M.jsonErr(400, errors.BadRequestResponse$inboundSchema), + M.jsonErr(401, errors.UnauthorizedResponse$inboundSchema), + M.jsonErr(402, errors.PaymentRequiredResponse$inboundSchema), + M.jsonErr(404, errors.NotFoundResponse$inboundSchema), + M.jsonErr(422, errors.UnprocessableResponse$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + M.json( + "default", + operations.AccountingBankAccountsAllResponse$inboundSchema, + { key: "UnexpectedErrorResponse" }, + ), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [haltIterator(result), { + status: "complete", + request: req, + response, + }]; + } + + const nextFunc = ( + responseData: unknown, + ): { + next: Paginator< + Result< + operations.AccountingBankAccountsAllResponse, + | errors.BadRequestResponse + | errors.UnauthorizedResponse + | errors.PaymentRequiredResponse + | errors.NotFoundResponse + | errors.UnprocessableResponse + | ApideckError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > + >; + "~next"?: { cursor: string }; + } => { + const nextCursor = dlv(responseData, "meta.cursors.next"); + if (typeof nextCursor !== "string") { + return { next: () => null }; + } + if (nextCursor.trim() === "") { + return { next: () => null }; + } + + const nextVal = () => + accountingBankAccountsList( + client, + { + ...request, + cursor: nextCursor, + }, + options, + ); + + return { next: nextVal, "~next": { cursor: nextCursor } }; + }; + + const page = { ...result, ...nextFunc(raw) }; + return [{ ...page, ...createPageIterator(page, (v) => !v.ok) }, { + status: "complete", + request: req, + response, + }]; +} diff --git a/src/funcs/accountingBankAccountsUpdate.ts b/src/funcs/accountingBankAccountsUpdate.ts new file mode 100644 index 00000000..3c920d0d --- /dev/null +++ b/src/funcs/accountingBankAccountsUpdate.ts @@ -0,0 +1,234 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ApideckCore } from "../core.js"; +import { encodeFormQuery, encodeJSON, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { ApideckError } from "../models/errors/apideckerror.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Update Bank Account + * + * @remarks + * Update Bank Account + */ +export function accountingBankAccountsUpdate( + client: ApideckCore, + request: operations.AccountingBankAccountsUpdateRequest, + options?: RequestOptions, +): APIPromise< + Result< + operations.AccountingBankAccountsUpdateResponse, + | errors.BadRequestResponse + | errors.UnauthorizedResponse + | errors.PaymentRequiredResponse + | errors.NotFoundResponse + | errors.UnprocessableResponse + | ApideckError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: ApideckCore, + request: operations.AccountingBankAccountsUpdateRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.AccountingBankAccountsUpdateResponse, + | errors.BadRequestResponse + | errors.UnauthorizedResponse + | errors.PaymentRequiredResponse + | errors.NotFoundResponse + | errors.UnprocessableResponse + | ApideckError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.AccountingBankAccountsUpdateRequest$outboundSchema.parse( + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload.AccountingBankAccount, { + explode: true, + }); + + const pathParams = { + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc("/accounting/bank-accounts/{id}")(pathParams); + + const query = encodeFormQuery({ + "raw": payload.raw, + }); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + "x-apideck-app-id": encodeSimple( + "x-apideck-app-id", + payload.appId ?? client._options.appId, + { explode: false, charEncoding: "none" }, + ), + "x-apideck-consumer-id": encodeSimple( + "x-apideck-consumer-id", + payload.consumerId ?? client._options.consumerId, + { explode: false, charEncoding: "none" }, + ), + "x-apideck-service-id": encodeSimple( + "x-apideck-service-id", + payload.serviceId, + { explode: false, charEncoding: "none" }, + ), + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "accounting.bankAccountsUpdate", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["408", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "PATCH", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "402", "404", "422", "4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.AccountingBankAccountsUpdateResponse, + | errors.BadRequestResponse + | errors.UnauthorizedResponse + | errors.PaymentRequiredResponse + | errors.NotFoundResponse + | errors.UnprocessableResponse + | ApideckError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.AccountingBankAccountsUpdateResponse$inboundSchema, { + key: "UpdateBankAccountResponse", + }), + M.jsonErr(400, errors.BadRequestResponse$inboundSchema), + M.jsonErr(401, errors.UnauthorizedResponse$inboundSchema), + M.jsonErr(402, errors.PaymentRequiredResponse$inboundSchema), + M.jsonErr(404, errors.NotFoundResponse$inboundSchema), + M.jsonErr(422, errors.UnprocessableResponse$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + M.json( + "default", + operations.AccountingBankAccountsUpdateResponse$inboundSchema, + { key: "UnexpectedErrorResponse" }, + ), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/lib/config.ts b/src/lib/config.ts index e8f0d3db..ff5b64c3 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -67,8 +67,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", - openapiDocVersion: "10.20.13", - sdkVersion: "0.29.8", - genVersion: "2.694.1", - userAgent: "speakeasy-sdk/typescript 0.29.8 2.694.1 10.20.13 @apideck/unify", + openapiDocVersion: "10.20.16", + sdkVersion: "0.29.9", + genVersion: "2.707.0", + userAgent: "speakeasy-sdk/typescript 0.29.9 2.707.0 10.20.16 @apideck/unify", } as const; diff --git a/src/models/components/accountingbankaccount.ts b/src/models/components/accountingbankaccount.ts new file mode 100644 index 00000000..b9429a80 --- /dev/null +++ b/src/models/components/accountingbankaccount.ts @@ -0,0 +1,576 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { ClosedEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + Currency, + Currency$inboundSchema, + Currency$outboundSchema, +} from "./currency.js"; +import { + CustomField, + CustomField$inboundSchema, + CustomField$Outbound, + CustomField$outboundSchema, +} from "./customfield.js"; + +/** + * The type of bank account + */ +export const AccountingBankAccountAccountType = { + Checking: "checking", + Savings: "savings", + CreditCard: "credit_card", + MoneyMarket: "money_market", + LineOfCredit: "line_of_credit", + Other: "other", +} as const; +/** + * The type of bank account + */ +export type AccountingBankAccountAccountType = ClosedEnum< + typeof AccountingBankAccountAccountType +>; + +/** + * The status of the bank account + */ +export const AccountingBankAccountStatus = { + Active: "active", + Inactive: "inactive", + Closed: "closed", +} as const; +/** + * The status of the bank account + */ +export type AccountingBankAccountStatus = ClosedEnum< + typeof AccountingBankAccountStatus +>; + +export type AccountingBankAccount = { + /** + * A unique identifier for an object. + */ + id: string; + /** + * Display ID for the bank account + */ + displayId?: string | null | undefined; + /** + * The name of the bank account as it appears in the accounting system + */ + name?: string | undefined; + /** + * The bank account number + */ + accountNumber?: string | null | undefined; + /** + * The type of bank account + */ + accountType?: AccountingBankAccountAccountType | undefined; + /** + * The name of the bank or financial institution + */ + bankName?: string | null | undefined; + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + currency?: Currency | null | undefined; + /** + * The current balance of the bank account + */ + balance?: number | null | undefined; + /** + * The available balance (considering pending transactions and overdraft) + */ + availableBalance?: number | null | undefined; + /** + * The overdraft limit for the account + */ + overdraftLimit?: number | null | undefined; + /** + * Bank routing number (US) + */ + routingNumber?: string | null | undefined; + /** + * International Bank Account Number + */ + iban?: string | null | undefined; + /** + * Bank Identifier Code / SWIFT Code + */ + bic?: string | null | undefined; + /** + * Bank State Branch number (Australia/New Zealand) + */ + bsbNumber?: string | null | undefined; + /** + * Bank branch identifier + */ + branchIdentifier?: string | null | undefined; + /** + * Bank code assigned by central bank + */ + bankCode?: string | null | undefined; + /** + * Country code according to ISO 3166-1 alpha-2. + */ + country?: string | null | undefined; + /** + * The status of the bank account + */ + status?: AccountingBankAccountStatus | null | undefined; + /** + * Description or notes about the bank account + */ + description?: string | null | undefined; + customFields?: Array | undefined; + /** + * When custom mappings are configured on the resource, the result is included here. + */ + customMappings?: { [k: string]: any } | null | undefined; + /** + * The date and time when the object was created. + */ + createdAt?: Date | null | undefined; + /** + * The date and time when the object was last updated. + */ + updatedAt?: Date | null | undefined; + /** + * The user who created the object. + */ + createdBy?: string | null | undefined; + /** + * The user who last updated the object. + */ + updatedBy?: string | null | undefined; +}; + +export type AccountingBankAccountInput = { + /** + * Display ID for the bank account + */ + displayId?: string | null | undefined; + /** + * The name of the bank account as it appears in the accounting system + */ + name?: string | undefined; + /** + * The bank account number + */ + accountNumber?: string | null | undefined; + /** + * The type of bank account + */ + accountType?: AccountingBankAccountAccountType | undefined; + /** + * The name of the bank or financial institution + */ + bankName?: string | null | undefined; + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + currency?: Currency | null | undefined; + /** + * The current balance of the bank account + */ + balance?: number | null | undefined; + /** + * The available balance (considering pending transactions and overdraft) + */ + availableBalance?: number | null | undefined; + /** + * The overdraft limit for the account + */ + overdraftLimit?: number | null | undefined; + /** + * Bank routing number (US) + */ + routingNumber?: string | null | undefined; + /** + * International Bank Account Number + */ + iban?: string | null | undefined; + /** + * Bank Identifier Code / SWIFT Code + */ + bic?: string | null | undefined; + /** + * Bank State Branch number (Australia/New Zealand) + */ + bsbNumber?: string | null | undefined; + /** + * Bank branch identifier + */ + branchIdentifier?: string | null | undefined; + /** + * Bank code assigned by central bank + */ + bankCode?: string | null | undefined; + /** + * Country code according to ISO 3166-1 alpha-2. + */ + country?: string | null | undefined; + /** + * The status of the bank account + */ + status?: AccountingBankAccountStatus | null | undefined; + /** + * Description or notes about the bank account + */ + description?: string | null | undefined; + customFields?: Array | undefined; +}; + +/** @internal */ +export const AccountingBankAccountAccountType$inboundSchema: z.ZodNativeEnum< + typeof AccountingBankAccountAccountType +> = z.nativeEnum(AccountingBankAccountAccountType); + +/** @internal */ +export const AccountingBankAccountAccountType$outboundSchema: z.ZodNativeEnum< + typeof AccountingBankAccountAccountType +> = AccountingBankAccountAccountType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AccountingBankAccountAccountType$ { + /** @deprecated use `AccountingBankAccountAccountType$inboundSchema` instead. */ + export const inboundSchema = AccountingBankAccountAccountType$inboundSchema; + /** @deprecated use `AccountingBankAccountAccountType$outboundSchema` instead. */ + export const outboundSchema = AccountingBankAccountAccountType$outboundSchema; +} + +/** @internal */ +export const AccountingBankAccountStatus$inboundSchema: z.ZodNativeEnum< + typeof AccountingBankAccountStatus +> = z.nativeEnum(AccountingBankAccountStatus); + +/** @internal */ +export const AccountingBankAccountStatus$outboundSchema: z.ZodNativeEnum< + typeof AccountingBankAccountStatus +> = AccountingBankAccountStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AccountingBankAccountStatus$ { + /** @deprecated use `AccountingBankAccountStatus$inboundSchema` instead. */ + export const inboundSchema = AccountingBankAccountStatus$inboundSchema; + /** @deprecated use `AccountingBankAccountStatus$outboundSchema` instead. */ + export const outboundSchema = AccountingBankAccountStatus$outboundSchema; +} + +/** @internal */ +export const AccountingBankAccount$inboundSchema: z.ZodType< + AccountingBankAccount, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.string(), + display_id: z.nullable(z.string()).optional(), + name: z.string().optional(), + account_number: z.nullable(z.string()).optional(), + account_type: AccountingBankAccountAccountType$inboundSchema.optional(), + bank_name: z.nullable(z.string()).optional(), + currency: z.nullable(Currency$inboundSchema).optional(), + balance: z.nullable(z.number()).optional(), + available_balance: z.nullable(z.number()).optional(), + overdraft_limit: z.nullable(z.number()).optional(), + routing_number: z.nullable(z.string()).optional(), + iban: z.nullable(z.string()).optional(), + bic: z.nullable(z.string()).optional(), + bsb_number: z.nullable(z.string()).optional(), + branch_identifier: z.nullable(z.string()).optional(), + bank_code: z.nullable(z.string()).optional(), + country: z.nullable(z.string()).optional(), + status: z.nullable(AccountingBankAccountStatus$inboundSchema).optional(), + description: z.nullable(z.string()).optional(), + custom_fields: z.array(CustomField$inboundSchema).optional(), + custom_mappings: z.nullable(z.record(z.any())).optional(), + created_at: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), + updated_at: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), + created_by: z.nullable(z.string()).optional(), + updated_by: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + "display_id": "displayId", + "account_number": "accountNumber", + "account_type": "accountType", + "bank_name": "bankName", + "available_balance": "availableBalance", + "overdraft_limit": "overdraftLimit", + "routing_number": "routingNumber", + "bsb_number": "bsbNumber", + "branch_identifier": "branchIdentifier", + "bank_code": "bankCode", + "custom_fields": "customFields", + "custom_mappings": "customMappings", + "created_at": "createdAt", + "updated_at": "updatedAt", + "created_by": "createdBy", + "updated_by": "updatedBy", + }); +}); + +/** @internal */ +export type AccountingBankAccount$Outbound = { + id: string; + display_id?: string | null | undefined; + name?: string | undefined; + account_number?: string | null | undefined; + account_type?: string | undefined; + bank_name?: string | null | undefined; + currency?: string | null | undefined; + balance?: number | null | undefined; + available_balance?: number | null | undefined; + overdraft_limit?: number | null | undefined; + routing_number?: string | null | undefined; + iban?: string | null | undefined; + bic?: string | null | undefined; + bsb_number?: string | null | undefined; + branch_identifier?: string | null | undefined; + bank_code?: string | null | undefined; + country?: string | null | undefined; + status?: string | null | undefined; + description?: string | null | undefined; + custom_fields?: Array | undefined; + custom_mappings?: { [k: string]: any } | null | undefined; + created_at?: string | null | undefined; + updated_at?: string | null | undefined; + created_by?: string | null | undefined; + updated_by?: string | null | undefined; +}; + +/** @internal */ +export const AccountingBankAccount$outboundSchema: z.ZodType< + AccountingBankAccount$Outbound, + z.ZodTypeDef, + AccountingBankAccount +> = z.object({ + id: z.string(), + displayId: z.nullable(z.string()).optional(), + name: z.string().optional(), + accountNumber: z.nullable(z.string()).optional(), + accountType: AccountingBankAccountAccountType$outboundSchema.optional(), + bankName: z.nullable(z.string()).optional(), + currency: z.nullable(Currency$outboundSchema).optional(), + balance: z.nullable(z.number()).optional(), + availableBalance: z.nullable(z.number()).optional(), + overdraftLimit: z.nullable(z.number()).optional(), + routingNumber: z.nullable(z.string()).optional(), + iban: z.nullable(z.string()).optional(), + bic: z.nullable(z.string()).optional(), + bsbNumber: z.nullable(z.string()).optional(), + branchIdentifier: z.nullable(z.string()).optional(), + bankCode: z.nullable(z.string()).optional(), + country: z.nullable(z.string()).optional(), + status: z.nullable(AccountingBankAccountStatus$outboundSchema).optional(), + description: z.nullable(z.string()).optional(), + customFields: z.array(CustomField$outboundSchema).optional(), + customMappings: z.nullable(z.record(z.any())).optional(), + createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(), + updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(), + createdBy: z.nullable(z.string()).optional(), + updatedBy: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + displayId: "display_id", + accountNumber: "account_number", + accountType: "account_type", + bankName: "bank_name", + availableBalance: "available_balance", + overdraftLimit: "overdraft_limit", + routingNumber: "routing_number", + bsbNumber: "bsb_number", + branchIdentifier: "branch_identifier", + bankCode: "bank_code", + customFields: "custom_fields", + customMappings: "custom_mappings", + createdAt: "created_at", + updatedAt: "updated_at", + createdBy: "created_by", + updatedBy: "updated_by", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AccountingBankAccount$ { + /** @deprecated use `AccountingBankAccount$inboundSchema` instead. */ + export const inboundSchema = AccountingBankAccount$inboundSchema; + /** @deprecated use `AccountingBankAccount$outboundSchema` instead. */ + export const outboundSchema = AccountingBankAccount$outboundSchema; + /** @deprecated use `AccountingBankAccount$Outbound` instead. */ + export type Outbound = AccountingBankAccount$Outbound; +} + +export function accountingBankAccountToJSON( + accountingBankAccount: AccountingBankAccount, +): string { + return JSON.stringify( + AccountingBankAccount$outboundSchema.parse(accountingBankAccount), + ); +} + +export function accountingBankAccountFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AccountingBankAccount$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AccountingBankAccount' from JSON`, + ); +} + +/** @internal */ +export const AccountingBankAccountInput$inboundSchema: z.ZodType< + AccountingBankAccountInput, + z.ZodTypeDef, + unknown +> = z.object({ + display_id: z.nullable(z.string()).optional(), + name: z.string().optional(), + account_number: z.nullable(z.string()).optional(), + account_type: AccountingBankAccountAccountType$inboundSchema.optional(), + bank_name: z.nullable(z.string()).optional(), + currency: z.nullable(Currency$inboundSchema).optional(), + balance: z.nullable(z.number()).optional(), + available_balance: z.nullable(z.number()).optional(), + overdraft_limit: z.nullable(z.number()).optional(), + routing_number: z.nullable(z.string()).optional(), + iban: z.nullable(z.string()).optional(), + bic: z.nullable(z.string()).optional(), + bsb_number: z.nullable(z.string()).optional(), + branch_identifier: z.nullable(z.string()).optional(), + bank_code: z.nullable(z.string()).optional(), + country: z.nullable(z.string()).optional(), + status: z.nullable(AccountingBankAccountStatus$inboundSchema).optional(), + description: z.nullable(z.string()).optional(), + custom_fields: z.array(CustomField$inboundSchema).optional(), +}).transform((v) => { + return remap$(v, { + "display_id": "displayId", + "account_number": "accountNumber", + "account_type": "accountType", + "bank_name": "bankName", + "available_balance": "availableBalance", + "overdraft_limit": "overdraftLimit", + "routing_number": "routingNumber", + "bsb_number": "bsbNumber", + "branch_identifier": "branchIdentifier", + "bank_code": "bankCode", + "custom_fields": "customFields", + }); +}); + +/** @internal */ +export type AccountingBankAccountInput$Outbound = { + display_id?: string | null | undefined; + name?: string | undefined; + account_number?: string | null | undefined; + account_type?: string | undefined; + bank_name?: string | null | undefined; + currency?: string | null | undefined; + balance?: number | null | undefined; + available_balance?: number | null | undefined; + overdraft_limit?: number | null | undefined; + routing_number?: string | null | undefined; + iban?: string | null | undefined; + bic?: string | null | undefined; + bsb_number?: string | null | undefined; + branch_identifier?: string | null | undefined; + bank_code?: string | null | undefined; + country?: string | null | undefined; + status?: string | null | undefined; + description?: string | null | undefined; + custom_fields?: Array | undefined; +}; + +/** @internal */ +export const AccountingBankAccountInput$outboundSchema: z.ZodType< + AccountingBankAccountInput$Outbound, + z.ZodTypeDef, + AccountingBankAccountInput +> = z.object({ + displayId: z.nullable(z.string()).optional(), + name: z.string().optional(), + accountNumber: z.nullable(z.string()).optional(), + accountType: AccountingBankAccountAccountType$outboundSchema.optional(), + bankName: z.nullable(z.string()).optional(), + currency: z.nullable(Currency$outboundSchema).optional(), + balance: z.nullable(z.number()).optional(), + availableBalance: z.nullable(z.number()).optional(), + overdraftLimit: z.nullable(z.number()).optional(), + routingNumber: z.nullable(z.string()).optional(), + iban: z.nullable(z.string()).optional(), + bic: z.nullable(z.string()).optional(), + bsbNumber: z.nullable(z.string()).optional(), + branchIdentifier: z.nullable(z.string()).optional(), + bankCode: z.nullable(z.string()).optional(), + country: z.nullable(z.string()).optional(), + status: z.nullable(AccountingBankAccountStatus$outboundSchema).optional(), + description: z.nullable(z.string()).optional(), + customFields: z.array(CustomField$outboundSchema).optional(), +}).transform((v) => { + return remap$(v, { + displayId: "display_id", + accountNumber: "account_number", + accountType: "account_type", + bankName: "bank_name", + availableBalance: "available_balance", + overdraftLimit: "overdraft_limit", + routingNumber: "routing_number", + bsbNumber: "bsb_number", + branchIdentifier: "branch_identifier", + bankCode: "bank_code", + customFields: "custom_fields", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AccountingBankAccountInput$ { + /** @deprecated use `AccountingBankAccountInput$inboundSchema` instead. */ + export const inboundSchema = AccountingBankAccountInput$inboundSchema; + /** @deprecated use `AccountingBankAccountInput$outboundSchema` instead. */ + export const outboundSchema = AccountingBankAccountInput$outboundSchema; + /** @deprecated use `AccountingBankAccountInput$Outbound` instead. */ + export type Outbound = AccountingBankAccountInput$Outbound; +} + +export function accountingBankAccountInputToJSON( + accountingBankAccountInput: AccountingBankAccountInput, +): string { + return JSON.stringify( + AccountingBankAccountInput$outboundSchema.parse(accountingBankAccountInput), + ); +} + +export function accountingBankAccountInputFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AccountingBankAccountInput$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AccountingBankAccountInput' from JSON`, + ); +} diff --git a/src/models/components/bankaccountsfilter.ts b/src/models/components/bankaccountsfilter.ts new file mode 100644 index 00000000..98059df2 --- /dev/null +++ b/src/models/components/bankaccountsfilter.ts @@ -0,0 +1,113 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { ClosedEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +/** + * Filter by account status + */ +export const BankAccountsFilterStatus = { + Active: "active", + Inactive: "inactive", + Closed: "closed", +} as const; +/** + * Filter by account status + */ +export type BankAccountsFilterStatus = ClosedEnum< + typeof BankAccountsFilterStatus +>; + +export type BankAccountsFilter = { + /** + * Filter by bank account name + */ + name?: string | undefined; + /** + * Filter by account status + */ + status?: BankAccountsFilterStatus | undefined; +}; + +/** @internal */ +export const BankAccountsFilterStatus$inboundSchema: z.ZodNativeEnum< + typeof BankAccountsFilterStatus +> = z.nativeEnum(BankAccountsFilterStatus); + +/** @internal */ +export const BankAccountsFilterStatus$outboundSchema: z.ZodNativeEnum< + typeof BankAccountsFilterStatus +> = BankAccountsFilterStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BankAccountsFilterStatus$ { + /** @deprecated use `BankAccountsFilterStatus$inboundSchema` instead. */ + export const inboundSchema = BankAccountsFilterStatus$inboundSchema; + /** @deprecated use `BankAccountsFilterStatus$outboundSchema` instead. */ + export const outboundSchema = BankAccountsFilterStatus$outboundSchema; +} + +/** @internal */ +export const BankAccountsFilter$inboundSchema: z.ZodType< + BankAccountsFilter, + z.ZodTypeDef, + unknown +> = z.object({ + name: z.string().optional(), + status: BankAccountsFilterStatus$inboundSchema.optional(), +}); + +/** @internal */ +export type BankAccountsFilter$Outbound = { + name?: string | undefined; + status?: string | undefined; +}; + +/** @internal */ +export const BankAccountsFilter$outboundSchema: z.ZodType< + BankAccountsFilter$Outbound, + z.ZodTypeDef, + BankAccountsFilter +> = z.object({ + name: z.string().optional(), + status: BankAccountsFilterStatus$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BankAccountsFilter$ { + /** @deprecated use `BankAccountsFilter$inboundSchema` instead. */ + export const inboundSchema = BankAccountsFilter$inboundSchema; + /** @deprecated use `BankAccountsFilter$outboundSchema` instead. */ + export const outboundSchema = BankAccountsFilter$outboundSchema; + /** @deprecated use `BankAccountsFilter$Outbound` instead. */ + export type Outbound = BankAccountsFilter$Outbound; +} + +export function bankAccountsFilterToJSON( + bankAccountsFilter: BankAccountsFilter, +): string { + return JSON.stringify( + BankAccountsFilter$outboundSchema.parse(bankAccountsFilter), + ); +} + +export function bankAccountsFilterFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BankAccountsFilter$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BankAccountsFilter' from JSON`, + ); +} diff --git a/src/models/components/bankaccountssort.ts b/src/models/components/bankaccountssort.ts new file mode 100644 index 00000000..46ef5c7c --- /dev/null +++ b/src/models/components/bankaccountssort.ts @@ -0,0 +1,113 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { ClosedEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + SortDirection, + SortDirection$inboundSchema, + SortDirection$outboundSchema, +} from "./sortdirection.js"; + +/** + * The field to sort by + */ +export const SortBy = { + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} as const; +/** + * The field to sort by + */ +export type SortBy = ClosedEnum; + +export type BankAccountsSort = { + /** + * The field to sort by + */ + by?: SortBy | undefined; + /** + * The direction in which to sort the results + */ + direction?: SortDirection | undefined; +}; + +/** @internal */ +export const SortBy$inboundSchema: z.ZodNativeEnum = z + .nativeEnum(SortBy); + +/** @internal */ +export const SortBy$outboundSchema: z.ZodNativeEnum = + SortBy$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SortBy$ { + /** @deprecated use `SortBy$inboundSchema` instead. */ + export const inboundSchema = SortBy$inboundSchema; + /** @deprecated use `SortBy$outboundSchema` instead. */ + export const outboundSchema = SortBy$outboundSchema; +} + +/** @internal */ +export const BankAccountsSort$inboundSchema: z.ZodType< + BankAccountsSort, + z.ZodTypeDef, + unknown +> = z.object({ + by: SortBy$inboundSchema.default("updated_at"), + direction: SortDirection$inboundSchema.default("asc"), +}); + +/** @internal */ +export type BankAccountsSort$Outbound = { + by: string; + direction: string; +}; + +/** @internal */ +export const BankAccountsSort$outboundSchema: z.ZodType< + BankAccountsSort$Outbound, + z.ZodTypeDef, + BankAccountsSort +> = z.object({ + by: SortBy$outboundSchema.default("updated_at"), + direction: SortDirection$outboundSchema.default("asc"), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BankAccountsSort$ { + /** @deprecated use `BankAccountsSort$inboundSchema` instead. */ + export const inboundSchema = BankAccountsSort$inboundSchema; + /** @deprecated use `BankAccountsSort$outboundSchema` instead. */ + export const outboundSchema = BankAccountsSort$outboundSchema; + /** @deprecated use `BankAccountsSort$Outbound` instead. */ + export type Outbound = BankAccountsSort$Outbound; +} + +export function bankAccountsSortToJSON( + bankAccountsSort: BankAccountsSort, +): string { + return JSON.stringify( + BankAccountsSort$outboundSchema.parse(bankAccountsSort), + ); +} + +export function bankAccountsSortFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BankAccountsSort$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BankAccountsSort' from JSON`, + ); +} diff --git a/src/models/components/createbankaccountresponse.ts b/src/models/components/createbankaccountresponse.ts new file mode 100644 index 00000000..d58a433d --- /dev/null +++ b/src/models/components/createbankaccountresponse.ts @@ -0,0 +1,122 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + UnifiedId, + UnifiedId$inboundSchema, + UnifiedId$Outbound, + UnifiedId$outboundSchema, +} from "./unifiedid.js"; + +/** + * Bank Account created + */ +export type CreateBankAccountResponse = { + /** + * HTTP Response Status Code + */ + statusCode: number; + /** + * HTTP Response Status + */ + status: string; + /** + * Apideck ID of service provider + */ + service?: string | undefined; + /** + * Unified API resource name + */ + resource?: string | undefined; + /** + * Operation performed + */ + operation?: string | undefined; + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + data: UnifiedId; +}; + +/** @internal */ +export const CreateBankAccountResponse$inboundSchema: z.ZodType< + CreateBankAccountResponse, + z.ZodTypeDef, + unknown +> = z.object({ + status_code: z.number().int(), + status: z.string(), + service: z.string().optional(), + resource: z.string().optional(), + operation: z.string().optional(), + data: UnifiedId$inboundSchema, +}).transform((v) => { + return remap$(v, { + "status_code": "statusCode", + }); +}); + +/** @internal */ +export type CreateBankAccountResponse$Outbound = { + status_code: number; + status: string; + service?: string | undefined; + resource?: string | undefined; + operation?: string | undefined; + data: UnifiedId$Outbound; +}; + +/** @internal */ +export const CreateBankAccountResponse$outboundSchema: z.ZodType< + CreateBankAccountResponse$Outbound, + z.ZodTypeDef, + CreateBankAccountResponse +> = z.object({ + statusCode: z.number().int(), + status: z.string(), + service: z.string().optional(), + resource: z.string().optional(), + operation: z.string().optional(), + data: UnifiedId$outboundSchema, +}).transform((v) => { + return remap$(v, { + statusCode: "status_code", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateBankAccountResponse$ { + /** @deprecated use `CreateBankAccountResponse$inboundSchema` instead. */ + export const inboundSchema = CreateBankAccountResponse$inboundSchema; + /** @deprecated use `CreateBankAccountResponse$outboundSchema` instead. */ + export const outboundSchema = CreateBankAccountResponse$outboundSchema; + /** @deprecated use `CreateBankAccountResponse$Outbound` instead. */ + export type Outbound = CreateBankAccountResponse$Outbound; +} + +export function createBankAccountResponseToJSON( + createBankAccountResponse: CreateBankAccountResponse, +): string { + return JSON.stringify( + CreateBankAccountResponse$outboundSchema.parse(createBankAccountResponse), + ); +} + +export function createBankAccountResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreateBankAccountResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateBankAccountResponse' from JSON`, + ); +} diff --git a/src/models/components/deletebankaccountresponse.ts b/src/models/components/deletebankaccountresponse.ts new file mode 100644 index 00000000..de2ec3cc --- /dev/null +++ b/src/models/components/deletebankaccountresponse.ts @@ -0,0 +1,122 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + UnifiedId, + UnifiedId$inboundSchema, + UnifiedId$Outbound, + UnifiedId$outboundSchema, +} from "./unifiedid.js"; + +/** + * Bank Account deleted + */ +export type DeleteBankAccountResponse = { + /** + * HTTP Response Status Code + */ + statusCode: number; + /** + * HTTP Response Status + */ + status: string; + /** + * Apideck ID of service provider + */ + service?: string | undefined; + /** + * Unified API resource name + */ + resource?: string | undefined; + /** + * Operation performed + */ + operation?: string | undefined; + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + data: UnifiedId; +}; + +/** @internal */ +export const DeleteBankAccountResponse$inboundSchema: z.ZodType< + DeleteBankAccountResponse, + z.ZodTypeDef, + unknown +> = z.object({ + status_code: z.number().int(), + status: z.string(), + service: z.string().optional(), + resource: z.string().optional(), + operation: z.string().optional(), + data: UnifiedId$inboundSchema, +}).transform((v) => { + return remap$(v, { + "status_code": "statusCode", + }); +}); + +/** @internal */ +export type DeleteBankAccountResponse$Outbound = { + status_code: number; + status: string; + service?: string | undefined; + resource?: string | undefined; + operation?: string | undefined; + data: UnifiedId$Outbound; +}; + +/** @internal */ +export const DeleteBankAccountResponse$outboundSchema: z.ZodType< + DeleteBankAccountResponse$Outbound, + z.ZodTypeDef, + DeleteBankAccountResponse +> = z.object({ + statusCode: z.number().int(), + status: z.string(), + service: z.string().optional(), + resource: z.string().optional(), + operation: z.string().optional(), + data: UnifiedId$outboundSchema, +}).transform((v) => { + return remap$(v, { + statusCode: "status_code", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeleteBankAccountResponse$ { + /** @deprecated use `DeleteBankAccountResponse$inboundSchema` instead. */ + export const inboundSchema = DeleteBankAccountResponse$inboundSchema; + /** @deprecated use `DeleteBankAccountResponse$outboundSchema` instead. */ + export const outboundSchema = DeleteBankAccountResponse$outboundSchema; + /** @deprecated use `DeleteBankAccountResponse$Outbound` instead. */ + export type Outbound = DeleteBankAccountResponse$Outbound; +} + +export function deleteBankAccountResponseToJSON( + deleteBankAccountResponse: DeleteBankAccountResponse, +): string { + return JSON.stringify( + DeleteBankAccountResponse$outboundSchema.parse(deleteBankAccountResponse), + ); +} + +export function deleteBankAccountResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => DeleteBankAccountResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DeleteBankAccountResponse' from JSON`, + ); +} diff --git a/src/models/components/getbankaccountresponse.ts b/src/models/components/getbankaccountresponse.ts new file mode 100644 index 00000000..972f4f7b --- /dev/null +++ b/src/models/components/getbankaccountresponse.ts @@ -0,0 +1,119 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + AccountingBankAccount, + AccountingBankAccount$inboundSchema, + AccountingBankAccount$Outbound, + AccountingBankAccount$outboundSchema, +} from "./accountingbankaccount.js"; + +/** + * Bank Account + */ +export type GetBankAccountResponse = { + /** + * HTTP Response Status Code + */ + statusCode: number; + /** + * HTTP Response Status + */ + status: string; + /** + * Apideck ID of service provider + */ + service?: string | undefined; + /** + * Unified API resource name + */ + resource?: string | undefined; + /** + * Operation performed + */ + operation?: string | undefined; + data: AccountingBankAccount; +}; + +/** @internal */ +export const GetBankAccountResponse$inboundSchema: z.ZodType< + GetBankAccountResponse, + z.ZodTypeDef, + unknown +> = z.object({ + status_code: z.number().int(), + status: z.string(), + service: z.string().optional(), + resource: z.string().optional(), + operation: z.string().optional(), + data: AccountingBankAccount$inboundSchema, +}).transform((v) => { + return remap$(v, { + "status_code": "statusCode", + }); +}); + +/** @internal */ +export type GetBankAccountResponse$Outbound = { + status_code: number; + status: string; + service?: string | undefined; + resource?: string | undefined; + operation?: string | undefined; + data: AccountingBankAccount$Outbound; +}; + +/** @internal */ +export const GetBankAccountResponse$outboundSchema: z.ZodType< + GetBankAccountResponse$Outbound, + z.ZodTypeDef, + GetBankAccountResponse +> = z.object({ + statusCode: z.number().int(), + status: z.string(), + service: z.string().optional(), + resource: z.string().optional(), + operation: z.string().optional(), + data: AccountingBankAccount$outboundSchema, +}).transform((v) => { + return remap$(v, { + statusCode: "status_code", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetBankAccountResponse$ { + /** @deprecated use `GetBankAccountResponse$inboundSchema` instead. */ + export const inboundSchema = GetBankAccountResponse$inboundSchema; + /** @deprecated use `GetBankAccountResponse$outboundSchema` instead. */ + export const outboundSchema = GetBankAccountResponse$outboundSchema; + /** @deprecated use `GetBankAccountResponse$Outbound` instead. */ + export type Outbound = GetBankAccountResponse$Outbound; +} + +export function getBankAccountResponseToJSON( + getBankAccountResponse: GetBankAccountResponse, +): string { + return JSON.stringify( + GetBankAccountResponse$outboundSchema.parse(getBankAccountResponse), + ); +} + +export function getBankAccountResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetBankAccountResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetBankAccountResponse' from JSON`, + ); +} diff --git a/src/models/components/getbankaccountsresponse.ts b/src/models/components/getbankaccountsresponse.ts new file mode 100644 index 00000000..c90d87ea --- /dev/null +++ b/src/models/components/getbankaccountsresponse.ts @@ -0,0 +1,145 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + AccountingBankAccount, + AccountingBankAccount$inboundSchema, + AccountingBankAccount$Outbound, + AccountingBankAccount$outboundSchema, +} from "./accountingbankaccount.js"; +import { + Links, + Links$inboundSchema, + Links$Outbound, + Links$outboundSchema, +} from "./links.js"; +import { + Meta, + Meta$inboundSchema, + Meta$Outbound, + Meta$outboundSchema, +} from "./meta.js"; + +/** + * Bank Accounts + */ +export type GetBankAccountsResponse = { + /** + * HTTP Response Status Code + */ + statusCode: number; + /** + * HTTP Response Status + */ + status: string; + /** + * Apideck ID of service provider + */ + service?: string | undefined; + /** + * Unified API resource name + */ + resource?: string | undefined; + /** + * Operation performed + */ + operation?: string | undefined; + data: Array; + /** + * Response metadata + */ + meta?: Meta | undefined; + /** + * Links to navigate to previous or next pages through the API + */ + links?: Links | undefined; +}; + +/** @internal */ +export const GetBankAccountsResponse$inboundSchema: z.ZodType< + GetBankAccountsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + status_code: z.number().int(), + status: z.string(), + service: z.string().optional(), + resource: z.string().optional(), + operation: z.string().optional(), + data: z.array(AccountingBankAccount$inboundSchema), + meta: Meta$inboundSchema.optional(), + links: Links$inboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + "status_code": "statusCode", + }); +}); + +/** @internal */ +export type GetBankAccountsResponse$Outbound = { + status_code: number; + status: string; + service?: string | undefined; + resource?: string | undefined; + operation?: string | undefined; + data: Array; + meta?: Meta$Outbound | undefined; + links?: Links$Outbound | undefined; +}; + +/** @internal */ +export const GetBankAccountsResponse$outboundSchema: z.ZodType< + GetBankAccountsResponse$Outbound, + z.ZodTypeDef, + GetBankAccountsResponse +> = z.object({ + statusCode: z.number().int(), + status: z.string(), + service: z.string().optional(), + resource: z.string().optional(), + operation: z.string().optional(), + data: z.array(AccountingBankAccount$outboundSchema), + meta: Meta$outboundSchema.optional(), + links: Links$outboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + statusCode: "status_code", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetBankAccountsResponse$ { + /** @deprecated use `GetBankAccountsResponse$inboundSchema` instead. */ + export const inboundSchema = GetBankAccountsResponse$inboundSchema; + /** @deprecated use `GetBankAccountsResponse$outboundSchema` instead. */ + export const outboundSchema = GetBankAccountsResponse$outboundSchema; + /** @deprecated use `GetBankAccountsResponse$Outbound` instead. */ + export type Outbound = GetBankAccountsResponse$Outbound; +} + +export function getBankAccountsResponseToJSON( + getBankAccountsResponse: GetBankAccountsResponse, +): string { + return JSON.stringify( + GetBankAccountsResponse$outboundSchema.parse(getBankAccountsResponse), + ); +} + +export function getBankAccountsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetBankAccountsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetBankAccountsResponse' from JSON`, + ); +} diff --git a/src/models/components/index.ts b/src/models/components/index.ts index b7af349d..c69456ce 100644 --- a/src/models/components/index.ts +++ b/src/models/components/index.ts @@ -2,6 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ +export * from "./accountingbankaccount.js"; export * from "./accountingdepartment.js"; export * from "./accountingdepartmentsfilter.js"; export * from "./accountinglocation.js"; @@ -35,6 +36,8 @@ export * from "./balancesheet.js"; export * from "./balancesheetfilter.js"; export * from "./bankaccount.js"; export * from "./bankaccount1.js"; +export * from "./bankaccountsfilter.js"; +export * from "./bankaccountssort.js"; export * from "./bankfeedaccount.js"; export * from "./bankfeedstatement.js"; export * from "./benefit.js"; @@ -85,6 +88,7 @@ export * from "./createactivityresponse.js"; export * from "./createapplicantresponse.js"; export * from "./createapplicationresponse.js"; export * from "./createattachmentresponse.js"; +export * from "./createbankaccountresponse.js"; export * from "./createbankfeedaccountresponse.js"; export * from "./createbankfeedstatementresponse.js"; export * from "./createbillpaymentresponse.js"; @@ -158,6 +162,7 @@ export * from "./deleteactivityresponse.js"; export * from "./deleteapplicantresponse.js"; export * from "./deleteapplicationresponse.js"; export * from "./deleteattachmentresponse.js"; +export * from "./deletebankaccountresponse.js"; export * from "./deletebankfeedaccountresponse.js"; export * from "./deletebankfeedstatementresponse.js"; export * from "./deletebillpaymentresponse.js"; @@ -264,6 +269,8 @@ export * from "./getapplicationsresponse.js"; export * from "./getattachmentresponse.js"; export * from "./getattachmentsresponse.js"; export * from "./getbalancesheetresponse.js"; +export * from "./getbankaccountresponse.js"; +export * from "./getbankaccountsresponse.js"; export * from "./getbankfeedaccountresponse.js"; export * from "./getbankfeedaccountsresponse.js"; export * from "./getbankfeedstatementresponse.js"; @@ -508,6 +515,7 @@ export * from "./updateaccountinglocationresponse.js"; export * from "./updateactivityresponse.js"; export * from "./updateapplicantresponse.js"; export * from "./updateapplicationresponse.js"; +export * from "./updatebankaccountresponse.js"; export * from "./updatebankfeedaccountresponse.js"; export * from "./updatebankfeedstatementresponse.js"; export * from "./updatebillpaymentresponse.js"; diff --git a/src/models/components/logsfilter.ts b/src/models/components/logsfilter.ts index f713e87c..bb98cdf0 100644 --- a/src/models/components/logsfilter.ts +++ b/src/models/components/logsfilter.ts @@ -10,7 +10,14 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type LogsFilter = { connectorId?: string | null | undefined; + /** + * Filter by a single HTTP status code. For backward compatibility - use status_codes for multiple values. + */ statusCode?: number | null | undefined; + /** + * Filter by multiple HTTP status codes. Values must be between 100-599. Maximum 50 status codes allowed. + */ + statusCodes?: Array | null | undefined; excludeUnifiedApis?: string | null | undefined; }; @@ -22,11 +29,13 @@ export const LogsFilter$inboundSchema: z.ZodType< > = z.object({ connector_id: z.nullable(z.string()).optional(), status_code: z.nullable(z.number()).optional(), + status_codes: z.nullable(z.array(z.number())).optional(), exclude_unified_apis: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "connector_id": "connectorId", "status_code": "statusCode", + "status_codes": "statusCodes", "exclude_unified_apis": "excludeUnifiedApis", }); }); @@ -35,6 +44,7 @@ export const LogsFilter$inboundSchema: z.ZodType< export type LogsFilter$Outbound = { connector_id?: string | null | undefined; status_code?: number | null | undefined; + status_codes?: Array | null | undefined; exclude_unified_apis?: string | null | undefined; }; @@ -46,11 +56,13 @@ export const LogsFilter$outboundSchema: z.ZodType< > = z.object({ connectorId: z.nullable(z.string()).optional(), statusCode: z.nullable(z.number()).optional(), + statusCodes: z.nullable(z.array(z.number())).optional(), excludeUnifiedApis: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { connectorId: "connector_id", statusCode: "status_code", + statusCodes: "status_codes", excludeUnifiedApis: "exclude_unified_apis", }); }); diff --git a/src/models/components/updatebankaccountresponse.ts b/src/models/components/updatebankaccountresponse.ts new file mode 100644 index 00000000..1caf0edd --- /dev/null +++ b/src/models/components/updatebankaccountresponse.ts @@ -0,0 +1,122 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + UnifiedId, + UnifiedId$inboundSchema, + UnifiedId$Outbound, + UnifiedId$outboundSchema, +} from "./unifiedid.js"; + +/** + * Bank Account updated + */ +export type UpdateBankAccountResponse = { + /** + * HTTP Response Status Code + */ + statusCode: number; + /** + * HTTP Response Status + */ + status: string; + /** + * Apideck ID of service provider + */ + service?: string | undefined; + /** + * Unified API resource name + */ + resource?: string | undefined; + /** + * Operation performed + */ + operation?: string | undefined; + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + data: UnifiedId; +}; + +/** @internal */ +export const UpdateBankAccountResponse$inboundSchema: z.ZodType< + UpdateBankAccountResponse, + z.ZodTypeDef, + unknown +> = z.object({ + status_code: z.number().int(), + status: z.string(), + service: z.string().optional(), + resource: z.string().optional(), + operation: z.string().optional(), + data: UnifiedId$inboundSchema, +}).transform((v) => { + return remap$(v, { + "status_code": "statusCode", + }); +}); + +/** @internal */ +export type UpdateBankAccountResponse$Outbound = { + status_code: number; + status: string; + service?: string | undefined; + resource?: string | undefined; + operation?: string | undefined; + data: UnifiedId$Outbound; +}; + +/** @internal */ +export const UpdateBankAccountResponse$outboundSchema: z.ZodType< + UpdateBankAccountResponse$Outbound, + z.ZodTypeDef, + UpdateBankAccountResponse +> = z.object({ + statusCode: z.number().int(), + status: z.string(), + service: z.string().optional(), + resource: z.string().optional(), + operation: z.string().optional(), + data: UnifiedId$outboundSchema, +}).transform((v) => { + return remap$(v, { + statusCode: "status_code", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateBankAccountResponse$ { + /** @deprecated use `UpdateBankAccountResponse$inboundSchema` instead. */ + export const inboundSchema = UpdateBankAccountResponse$inboundSchema; + /** @deprecated use `UpdateBankAccountResponse$outboundSchema` instead. */ + export const outboundSchema = UpdateBankAccountResponse$outboundSchema; + /** @deprecated use `UpdateBankAccountResponse$Outbound` instead. */ + export type Outbound = UpdateBankAccountResponse$Outbound; +} + +export function updateBankAccountResponseToJSON( + updateBankAccountResponse: UpdateBankAccountResponse, +): string { + return JSON.stringify( + UpdateBankAccountResponse$outboundSchema.parse(updateBankAccountResponse), + ); +} + +export function updateBankAccountResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdateBankAccountResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdateBankAccountResponse' from JSON`, + ); +} diff --git a/src/models/operations/accountingbankaccountsadd.ts b/src/models/operations/accountingbankaccountsadd.ts new file mode 100644 index 00000000..896ce340 --- /dev/null +++ b/src/models/operations/accountingbankaccountsadd.ts @@ -0,0 +1,271 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as components from "../components/index.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type AccountingBankAccountsAddGlobals = { + /** + * ID of the consumer which you want to get or push data from + */ + consumerId?: string | undefined; + /** + * The ID of your Unify application + */ + appId?: string | undefined; +}; + +export type AccountingBankAccountsAddRequest = { + /** + * Include raw response. Mostly used for debugging purposes + */ + raw?: boolean | undefined; + /** + * ID of the consumer which you want to get or push data from + */ + consumerId?: string | undefined; + /** + * The ID of your Unify application + */ + appId?: string | undefined; + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + */ + serviceId?: string | undefined; + accountingBankAccount: components.AccountingBankAccountInput; +}; + +export type AccountingBankAccountsAddResponse = { + httpMeta: components.HTTPMetadata; + /** + * Bank Account created + */ + createBankAccountResponse?: components.CreateBankAccountResponse | undefined; + /** + * Unexpected error + */ + unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; +}; + +/** @internal */ +export const AccountingBankAccountsAddGlobals$inboundSchema: z.ZodType< + AccountingBankAccountsAddGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + consumerId: z.string().optional(), + appId: z.string().optional(), +}); + +/** @internal */ +export type AccountingBankAccountsAddGlobals$Outbound = { + consumerId?: string | undefined; + appId?: string | undefined; +}; + +/** @internal */ +export const AccountingBankAccountsAddGlobals$outboundSchema: z.ZodType< + AccountingBankAccountsAddGlobals$Outbound, + z.ZodTypeDef, + AccountingBankAccountsAddGlobals +> = z.object({ + consumerId: z.string().optional(), + appId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AccountingBankAccountsAddGlobals$ { + /** @deprecated use `AccountingBankAccountsAddGlobals$inboundSchema` instead. */ + export const inboundSchema = AccountingBankAccountsAddGlobals$inboundSchema; + /** @deprecated use `AccountingBankAccountsAddGlobals$outboundSchema` instead. */ + export const outboundSchema = AccountingBankAccountsAddGlobals$outboundSchema; + /** @deprecated use `AccountingBankAccountsAddGlobals$Outbound` instead. */ + export type Outbound = AccountingBankAccountsAddGlobals$Outbound; +} + +export function accountingBankAccountsAddGlobalsToJSON( + accountingBankAccountsAddGlobals: AccountingBankAccountsAddGlobals, +): string { + return JSON.stringify( + AccountingBankAccountsAddGlobals$outboundSchema.parse( + accountingBankAccountsAddGlobals, + ), + ); +} + +export function accountingBankAccountsAddGlobalsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AccountingBankAccountsAddGlobals$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AccountingBankAccountsAddGlobals' from JSON`, + ); +} + +/** @internal */ +export const AccountingBankAccountsAddRequest$inboundSchema: z.ZodType< + AccountingBankAccountsAddRequest, + z.ZodTypeDef, + unknown +> = z.object({ + raw: z.boolean().default(false), + consumerId: z.string().optional(), + appId: z.string().optional(), + serviceId: z.string().optional(), + AccountingBankAccount: components.AccountingBankAccountInput$inboundSchema, +}).transform((v) => { + return remap$(v, { + "AccountingBankAccount": "accountingBankAccount", + }); +}); + +/** @internal */ +export type AccountingBankAccountsAddRequest$Outbound = { + raw: boolean; + consumerId?: string | undefined; + appId?: string | undefined; + serviceId?: string | undefined; + AccountingBankAccount: components.AccountingBankAccountInput$Outbound; +}; + +/** @internal */ +export const AccountingBankAccountsAddRequest$outboundSchema: z.ZodType< + AccountingBankAccountsAddRequest$Outbound, + z.ZodTypeDef, + AccountingBankAccountsAddRequest +> = z.object({ + raw: z.boolean().default(false), + consumerId: z.string().optional(), + appId: z.string().optional(), + serviceId: z.string().optional(), + accountingBankAccount: components.AccountingBankAccountInput$outboundSchema, +}).transform((v) => { + return remap$(v, { + accountingBankAccount: "AccountingBankAccount", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AccountingBankAccountsAddRequest$ { + /** @deprecated use `AccountingBankAccountsAddRequest$inboundSchema` instead. */ + export const inboundSchema = AccountingBankAccountsAddRequest$inboundSchema; + /** @deprecated use `AccountingBankAccountsAddRequest$outboundSchema` instead. */ + export const outboundSchema = AccountingBankAccountsAddRequest$outboundSchema; + /** @deprecated use `AccountingBankAccountsAddRequest$Outbound` instead. */ + export type Outbound = AccountingBankAccountsAddRequest$Outbound; +} + +export function accountingBankAccountsAddRequestToJSON( + accountingBankAccountsAddRequest: AccountingBankAccountsAddRequest, +): string { + return JSON.stringify( + AccountingBankAccountsAddRequest$outboundSchema.parse( + accountingBankAccountsAddRequest, + ), + ); +} + +export function accountingBankAccountsAddRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AccountingBankAccountsAddRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AccountingBankAccountsAddRequest' from JSON`, + ); +} + +/** @internal */ +export const AccountingBankAccountsAddResponse$inboundSchema: z.ZodType< + AccountingBankAccountsAddResponse, + z.ZodTypeDef, + unknown +> = z.object({ + HttpMeta: components.HTTPMetadata$inboundSchema, + CreateBankAccountResponse: components.CreateBankAccountResponse$inboundSchema + .optional(), + UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema + .optional(), +}).transform((v) => { + return remap$(v, { + "HttpMeta": "httpMeta", + "CreateBankAccountResponse": "createBankAccountResponse", + "UnexpectedErrorResponse": "unexpectedErrorResponse", + }); +}); + +/** @internal */ +export type AccountingBankAccountsAddResponse$Outbound = { + HttpMeta: components.HTTPMetadata$Outbound; + CreateBankAccountResponse?: + | components.CreateBankAccountResponse$Outbound + | undefined; + UnexpectedErrorResponse?: + | components.UnexpectedErrorResponse$Outbound + | undefined; +}; + +/** @internal */ +export const AccountingBankAccountsAddResponse$outboundSchema: z.ZodType< + AccountingBankAccountsAddResponse$Outbound, + z.ZodTypeDef, + AccountingBankAccountsAddResponse +> = z.object({ + httpMeta: components.HTTPMetadata$outboundSchema, + createBankAccountResponse: components.CreateBankAccountResponse$outboundSchema + .optional(), + unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema + .optional(), +}).transform((v) => { + return remap$(v, { + httpMeta: "HttpMeta", + createBankAccountResponse: "CreateBankAccountResponse", + unexpectedErrorResponse: "UnexpectedErrorResponse", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AccountingBankAccountsAddResponse$ { + /** @deprecated use `AccountingBankAccountsAddResponse$inboundSchema` instead. */ + export const inboundSchema = AccountingBankAccountsAddResponse$inboundSchema; + /** @deprecated use `AccountingBankAccountsAddResponse$outboundSchema` instead. */ + export const outboundSchema = + AccountingBankAccountsAddResponse$outboundSchema; + /** @deprecated use `AccountingBankAccountsAddResponse$Outbound` instead. */ + export type Outbound = AccountingBankAccountsAddResponse$Outbound; +} + +export function accountingBankAccountsAddResponseToJSON( + accountingBankAccountsAddResponse: AccountingBankAccountsAddResponse, +): string { + return JSON.stringify( + AccountingBankAccountsAddResponse$outboundSchema.parse( + accountingBankAccountsAddResponse, + ), + ); +} + +export function accountingBankAccountsAddResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AccountingBankAccountsAddResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AccountingBankAccountsAddResponse' from JSON`, + ); +} diff --git a/src/models/operations/accountingbankaccountsall.ts b/src/models/operations/accountingbankaccountsall.ts new file mode 100644 index 00000000..f26bfc49 --- /dev/null +++ b/src/models/operations/accountingbankaccountsall.ts @@ -0,0 +1,309 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as components from "../components/index.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type AccountingBankAccountsAllGlobals = { + /** + * ID of the consumer which you want to get or push data from + */ + consumerId?: string | undefined; + /** + * The ID of your Unify application + */ + appId?: string | undefined; +}; + +export type AccountingBankAccountsAllRequest = { + /** + * Include raw response. Mostly used for debugging purposes + */ + raw?: boolean | undefined; + /** + * ID of the consumer which you want to get or push data from + */ + consumerId?: string | undefined; + /** + * The ID of your Unify application + */ + appId?: string | undefined; + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + */ + serviceId?: string | undefined; + /** + * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + */ + cursor?: string | null | undefined; + /** + * Number of results to return. Minimum 1, Maximum 200, Default 20 + */ + limit?: number | undefined; + /** + * Apply filters + */ + filter?: components.BankAccountsFilter | undefined; + /** + * Apply sorting + */ + sort?: components.BankAccountsSort | undefined; + /** + * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + */ + passThrough?: { [k: string]: any } | undefined; + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. + */ + fields?: string | null | undefined; +}; + +export type AccountingBankAccountsAllResponse = { + httpMeta: components.HTTPMetadata; + /** + * Bank Accounts + */ + getBankAccountsResponse?: components.GetBankAccountsResponse | undefined; + /** + * Unexpected error + */ + unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; +}; + +/** @internal */ +export const AccountingBankAccountsAllGlobals$inboundSchema: z.ZodType< + AccountingBankAccountsAllGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + consumerId: z.string().optional(), + appId: z.string().optional(), +}); + +/** @internal */ +export type AccountingBankAccountsAllGlobals$Outbound = { + consumerId?: string | undefined; + appId?: string | undefined; +}; + +/** @internal */ +export const AccountingBankAccountsAllGlobals$outboundSchema: z.ZodType< + AccountingBankAccountsAllGlobals$Outbound, + z.ZodTypeDef, + AccountingBankAccountsAllGlobals +> = z.object({ + consumerId: z.string().optional(), + appId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AccountingBankAccountsAllGlobals$ { + /** @deprecated use `AccountingBankAccountsAllGlobals$inboundSchema` instead. */ + export const inboundSchema = AccountingBankAccountsAllGlobals$inboundSchema; + /** @deprecated use `AccountingBankAccountsAllGlobals$outboundSchema` instead. */ + export const outboundSchema = AccountingBankAccountsAllGlobals$outboundSchema; + /** @deprecated use `AccountingBankAccountsAllGlobals$Outbound` instead. */ + export type Outbound = AccountingBankAccountsAllGlobals$Outbound; +} + +export function accountingBankAccountsAllGlobalsToJSON( + accountingBankAccountsAllGlobals: AccountingBankAccountsAllGlobals, +): string { + return JSON.stringify( + AccountingBankAccountsAllGlobals$outboundSchema.parse( + accountingBankAccountsAllGlobals, + ), + ); +} + +export function accountingBankAccountsAllGlobalsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AccountingBankAccountsAllGlobals$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AccountingBankAccountsAllGlobals' from JSON`, + ); +} + +/** @internal */ +export const AccountingBankAccountsAllRequest$inboundSchema: z.ZodType< + AccountingBankAccountsAllRequest, + z.ZodTypeDef, + unknown +> = z.object({ + raw: z.boolean().default(false), + consumerId: z.string().optional(), + appId: z.string().optional(), + serviceId: z.string().optional(), + cursor: z.nullable(z.string()).optional(), + limit: z.number().int().default(20), + filter: components.BankAccountsFilter$inboundSchema.optional(), + sort: components.BankAccountsSort$inboundSchema.optional(), + pass_through: z.record(z.any()).optional(), + fields: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + "pass_through": "passThrough", + }); +}); + +/** @internal */ +export type AccountingBankAccountsAllRequest$Outbound = { + raw: boolean; + consumerId?: string | undefined; + appId?: string | undefined; + serviceId?: string | undefined; + cursor?: string | null | undefined; + limit: number; + filter?: components.BankAccountsFilter$Outbound | undefined; + sort?: components.BankAccountsSort$Outbound | undefined; + pass_through?: { [k: string]: any } | undefined; + fields?: string | null | undefined; +}; + +/** @internal */ +export const AccountingBankAccountsAllRequest$outboundSchema: z.ZodType< + AccountingBankAccountsAllRequest$Outbound, + z.ZodTypeDef, + AccountingBankAccountsAllRequest +> = z.object({ + raw: z.boolean().default(false), + consumerId: z.string().optional(), + appId: z.string().optional(), + serviceId: z.string().optional(), + cursor: z.nullable(z.string()).optional(), + limit: z.number().int().default(20), + filter: components.BankAccountsFilter$outboundSchema.optional(), + sort: components.BankAccountsSort$outboundSchema.optional(), + passThrough: z.record(z.any()).optional(), + fields: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + passThrough: "pass_through", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AccountingBankAccountsAllRequest$ { + /** @deprecated use `AccountingBankAccountsAllRequest$inboundSchema` instead. */ + export const inboundSchema = AccountingBankAccountsAllRequest$inboundSchema; + /** @deprecated use `AccountingBankAccountsAllRequest$outboundSchema` instead. */ + export const outboundSchema = AccountingBankAccountsAllRequest$outboundSchema; + /** @deprecated use `AccountingBankAccountsAllRequest$Outbound` instead. */ + export type Outbound = AccountingBankAccountsAllRequest$Outbound; +} + +export function accountingBankAccountsAllRequestToJSON( + accountingBankAccountsAllRequest: AccountingBankAccountsAllRequest, +): string { + return JSON.stringify( + AccountingBankAccountsAllRequest$outboundSchema.parse( + accountingBankAccountsAllRequest, + ), + ); +} + +export function accountingBankAccountsAllRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AccountingBankAccountsAllRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AccountingBankAccountsAllRequest' from JSON`, + ); +} + +/** @internal */ +export const AccountingBankAccountsAllResponse$inboundSchema: z.ZodType< + AccountingBankAccountsAllResponse, + z.ZodTypeDef, + unknown +> = z.object({ + HttpMeta: components.HTTPMetadata$inboundSchema, + GetBankAccountsResponse: components.GetBankAccountsResponse$inboundSchema + .optional(), + UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema + .optional(), +}).transform((v) => { + return remap$(v, { + "HttpMeta": "httpMeta", + "GetBankAccountsResponse": "getBankAccountsResponse", + "UnexpectedErrorResponse": "unexpectedErrorResponse", + }); +}); + +/** @internal */ +export type AccountingBankAccountsAllResponse$Outbound = { + HttpMeta: components.HTTPMetadata$Outbound; + GetBankAccountsResponse?: + | components.GetBankAccountsResponse$Outbound + | undefined; + UnexpectedErrorResponse?: + | components.UnexpectedErrorResponse$Outbound + | undefined; +}; + +/** @internal */ +export const AccountingBankAccountsAllResponse$outboundSchema: z.ZodType< + AccountingBankAccountsAllResponse$Outbound, + z.ZodTypeDef, + AccountingBankAccountsAllResponse +> = z.object({ + httpMeta: components.HTTPMetadata$outboundSchema, + getBankAccountsResponse: components.GetBankAccountsResponse$outboundSchema + .optional(), + unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema + .optional(), +}).transform((v) => { + return remap$(v, { + httpMeta: "HttpMeta", + getBankAccountsResponse: "GetBankAccountsResponse", + unexpectedErrorResponse: "UnexpectedErrorResponse", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AccountingBankAccountsAllResponse$ { + /** @deprecated use `AccountingBankAccountsAllResponse$inboundSchema` instead. */ + export const inboundSchema = AccountingBankAccountsAllResponse$inboundSchema; + /** @deprecated use `AccountingBankAccountsAllResponse$outboundSchema` instead. */ + export const outboundSchema = + AccountingBankAccountsAllResponse$outboundSchema; + /** @deprecated use `AccountingBankAccountsAllResponse$Outbound` instead. */ + export type Outbound = AccountingBankAccountsAllResponse$Outbound; +} + +export function accountingBankAccountsAllResponseToJSON( + accountingBankAccountsAllResponse: AccountingBankAccountsAllResponse, +): string { + return JSON.stringify( + AccountingBankAccountsAllResponse$outboundSchema.parse( + accountingBankAccountsAllResponse, + ), + ); +} + +export function accountingBankAccountsAllResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AccountingBankAccountsAllResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AccountingBankAccountsAllResponse' from JSON`, + ); +} diff --git a/src/models/operations/accountingbankaccountsdelete.ts b/src/models/operations/accountingbankaccountsdelete.ts new file mode 100644 index 00000000..c7871c63 --- /dev/null +++ b/src/models/operations/accountingbankaccountsdelete.ts @@ -0,0 +1,274 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as components from "../components/index.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type AccountingBankAccountsDeleteGlobals = { + /** + * ID of the consumer which you want to get or push data from + */ + consumerId?: string | undefined; + /** + * The ID of your Unify application + */ + appId?: string | undefined; +}; + +export type AccountingBankAccountsDeleteRequest = { + /** + * ID of the record you are acting upon. + */ + id: string; + /** + * ID of the consumer which you want to get or push data from + */ + consumerId?: string | undefined; + /** + * The ID of your Unify application + */ + appId?: string | undefined; + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + */ + serviceId?: string | undefined; + /** + * Include raw response. Mostly used for debugging purposes + */ + raw?: boolean | undefined; +}; + +export type AccountingBankAccountsDeleteResponse = { + httpMeta: components.HTTPMetadata; + /** + * Bank Account deleted + */ + deleteBankAccountResponse?: components.DeleteBankAccountResponse | undefined; + /** + * Unexpected error + */ + unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; +}; + +/** @internal */ +export const AccountingBankAccountsDeleteGlobals$inboundSchema: z.ZodType< + AccountingBankAccountsDeleteGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + consumerId: z.string().optional(), + appId: z.string().optional(), +}); + +/** @internal */ +export type AccountingBankAccountsDeleteGlobals$Outbound = { + consumerId?: string | undefined; + appId?: string | undefined; +}; + +/** @internal */ +export const AccountingBankAccountsDeleteGlobals$outboundSchema: z.ZodType< + AccountingBankAccountsDeleteGlobals$Outbound, + z.ZodTypeDef, + AccountingBankAccountsDeleteGlobals +> = z.object({ + consumerId: z.string().optional(), + appId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AccountingBankAccountsDeleteGlobals$ { + /** @deprecated use `AccountingBankAccountsDeleteGlobals$inboundSchema` instead. */ + export const inboundSchema = + AccountingBankAccountsDeleteGlobals$inboundSchema; + /** @deprecated use `AccountingBankAccountsDeleteGlobals$outboundSchema` instead. */ + export const outboundSchema = + AccountingBankAccountsDeleteGlobals$outboundSchema; + /** @deprecated use `AccountingBankAccountsDeleteGlobals$Outbound` instead. */ + export type Outbound = AccountingBankAccountsDeleteGlobals$Outbound; +} + +export function accountingBankAccountsDeleteGlobalsToJSON( + accountingBankAccountsDeleteGlobals: AccountingBankAccountsDeleteGlobals, +): string { + return JSON.stringify( + AccountingBankAccountsDeleteGlobals$outboundSchema.parse( + accountingBankAccountsDeleteGlobals, + ), + ); +} + +export function accountingBankAccountsDeleteGlobalsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + AccountingBankAccountsDeleteGlobals$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AccountingBankAccountsDeleteGlobals' from JSON`, + ); +} + +/** @internal */ +export const AccountingBankAccountsDeleteRequest$inboundSchema: z.ZodType< + AccountingBankAccountsDeleteRequest, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.string(), + consumerId: z.string().optional(), + appId: z.string().optional(), + serviceId: z.string().optional(), + raw: z.boolean().default(false), +}); + +/** @internal */ +export type AccountingBankAccountsDeleteRequest$Outbound = { + id: string; + consumerId?: string | undefined; + appId?: string | undefined; + serviceId?: string | undefined; + raw: boolean; +}; + +/** @internal */ +export const AccountingBankAccountsDeleteRequest$outboundSchema: z.ZodType< + AccountingBankAccountsDeleteRequest$Outbound, + z.ZodTypeDef, + AccountingBankAccountsDeleteRequest +> = z.object({ + id: z.string(), + consumerId: z.string().optional(), + appId: z.string().optional(), + serviceId: z.string().optional(), + raw: z.boolean().default(false), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AccountingBankAccountsDeleteRequest$ { + /** @deprecated use `AccountingBankAccountsDeleteRequest$inboundSchema` instead. */ + export const inboundSchema = + AccountingBankAccountsDeleteRequest$inboundSchema; + /** @deprecated use `AccountingBankAccountsDeleteRequest$outboundSchema` instead. */ + export const outboundSchema = + AccountingBankAccountsDeleteRequest$outboundSchema; + /** @deprecated use `AccountingBankAccountsDeleteRequest$Outbound` instead. */ + export type Outbound = AccountingBankAccountsDeleteRequest$Outbound; +} + +export function accountingBankAccountsDeleteRequestToJSON( + accountingBankAccountsDeleteRequest: AccountingBankAccountsDeleteRequest, +): string { + return JSON.stringify( + AccountingBankAccountsDeleteRequest$outboundSchema.parse( + accountingBankAccountsDeleteRequest, + ), + ); +} + +export function accountingBankAccountsDeleteRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + AccountingBankAccountsDeleteRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AccountingBankAccountsDeleteRequest' from JSON`, + ); +} + +/** @internal */ +export const AccountingBankAccountsDeleteResponse$inboundSchema: z.ZodType< + AccountingBankAccountsDeleteResponse, + z.ZodTypeDef, + unknown +> = z.object({ + HttpMeta: components.HTTPMetadata$inboundSchema, + DeleteBankAccountResponse: components.DeleteBankAccountResponse$inboundSchema + .optional(), + UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema + .optional(), +}).transform((v) => { + return remap$(v, { + "HttpMeta": "httpMeta", + "DeleteBankAccountResponse": "deleteBankAccountResponse", + "UnexpectedErrorResponse": "unexpectedErrorResponse", + }); +}); + +/** @internal */ +export type AccountingBankAccountsDeleteResponse$Outbound = { + HttpMeta: components.HTTPMetadata$Outbound; + DeleteBankAccountResponse?: + | components.DeleteBankAccountResponse$Outbound + | undefined; + UnexpectedErrorResponse?: + | components.UnexpectedErrorResponse$Outbound + | undefined; +}; + +/** @internal */ +export const AccountingBankAccountsDeleteResponse$outboundSchema: z.ZodType< + AccountingBankAccountsDeleteResponse$Outbound, + z.ZodTypeDef, + AccountingBankAccountsDeleteResponse +> = z.object({ + httpMeta: components.HTTPMetadata$outboundSchema, + deleteBankAccountResponse: components.DeleteBankAccountResponse$outboundSchema + .optional(), + unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema + .optional(), +}).transform((v) => { + return remap$(v, { + httpMeta: "HttpMeta", + deleteBankAccountResponse: "DeleteBankAccountResponse", + unexpectedErrorResponse: "UnexpectedErrorResponse", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AccountingBankAccountsDeleteResponse$ { + /** @deprecated use `AccountingBankAccountsDeleteResponse$inboundSchema` instead. */ + export const inboundSchema = + AccountingBankAccountsDeleteResponse$inboundSchema; + /** @deprecated use `AccountingBankAccountsDeleteResponse$outboundSchema` instead. */ + export const outboundSchema = + AccountingBankAccountsDeleteResponse$outboundSchema; + /** @deprecated use `AccountingBankAccountsDeleteResponse$Outbound` instead. */ + export type Outbound = AccountingBankAccountsDeleteResponse$Outbound; +} + +export function accountingBankAccountsDeleteResponseToJSON( + accountingBankAccountsDeleteResponse: AccountingBankAccountsDeleteResponse, +): string { + return JSON.stringify( + AccountingBankAccountsDeleteResponse$outboundSchema.parse( + accountingBankAccountsDeleteResponse, + ), + ); +} + +export function accountingBankAccountsDeleteResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + AccountingBankAccountsDeleteResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AccountingBankAccountsDeleteResponse' from JSON`, + ); +} diff --git a/src/models/operations/accountingbankaccountsone.ts b/src/models/operations/accountingbankaccountsone.ts new file mode 100644 index 00000000..54df7aba --- /dev/null +++ b/src/models/operations/accountingbankaccountsone.ts @@ -0,0 +1,273 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as components from "../components/index.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type AccountingBankAccountsOneGlobals = { + /** + * ID of the consumer which you want to get or push data from + */ + consumerId?: string | undefined; + /** + * The ID of your Unify application + */ + appId?: string | undefined; +}; + +export type AccountingBankAccountsOneRequest = { + /** + * ID of the record you are acting upon. + */ + id: string; + /** + * ID of the consumer which you want to get or push data from + */ + consumerId?: string | undefined; + /** + * The ID of your Unify application + */ + appId?: string | undefined; + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + */ + serviceId?: string | undefined; + /** + * Include raw response. Mostly used for debugging purposes + */ + raw?: boolean | undefined; + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. + */ + fields?: string | null | undefined; +}; + +export type AccountingBankAccountsOneResponse = { + httpMeta: components.HTTPMetadata; + /** + * Bank Account + */ + getBankAccountResponse?: components.GetBankAccountResponse | undefined; + /** + * Unexpected error + */ + unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; +}; + +/** @internal */ +export const AccountingBankAccountsOneGlobals$inboundSchema: z.ZodType< + AccountingBankAccountsOneGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + consumerId: z.string().optional(), + appId: z.string().optional(), +}); + +/** @internal */ +export type AccountingBankAccountsOneGlobals$Outbound = { + consumerId?: string | undefined; + appId?: string | undefined; +}; + +/** @internal */ +export const AccountingBankAccountsOneGlobals$outboundSchema: z.ZodType< + AccountingBankAccountsOneGlobals$Outbound, + z.ZodTypeDef, + AccountingBankAccountsOneGlobals +> = z.object({ + consumerId: z.string().optional(), + appId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AccountingBankAccountsOneGlobals$ { + /** @deprecated use `AccountingBankAccountsOneGlobals$inboundSchema` instead. */ + export const inboundSchema = AccountingBankAccountsOneGlobals$inboundSchema; + /** @deprecated use `AccountingBankAccountsOneGlobals$outboundSchema` instead. */ + export const outboundSchema = AccountingBankAccountsOneGlobals$outboundSchema; + /** @deprecated use `AccountingBankAccountsOneGlobals$Outbound` instead. */ + export type Outbound = AccountingBankAccountsOneGlobals$Outbound; +} + +export function accountingBankAccountsOneGlobalsToJSON( + accountingBankAccountsOneGlobals: AccountingBankAccountsOneGlobals, +): string { + return JSON.stringify( + AccountingBankAccountsOneGlobals$outboundSchema.parse( + accountingBankAccountsOneGlobals, + ), + ); +} + +export function accountingBankAccountsOneGlobalsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AccountingBankAccountsOneGlobals$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AccountingBankAccountsOneGlobals' from JSON`, + ); +} + +/** @internal */ +export const AccountingBankAccountsOneRequest$inboundSchema: z.ZodType< + AccountingBankAccountsOneRequest, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.string(), + consumerId: z.string().optional(), + appId: z.string().optional(), + serviceId: z.string().optional(), + raw: z.boolean().default(false), + fields: z.nullable(z.string()).optional(), +}); + +/** @internal */ +export type AccountingBankAccountsOneRequest$Outbound = { + id: string; + consumerId?: string | undefined; + appId?: string | undefined; + serviceId?: string | undefined; + raw: boolean; + fields?: string | null | undefined; +}; + +/** @internal */ +export const AccountingBankAccountsOneRequest$outboundSchema: z.ZodType< + AccountingBankAccountsOneRequest$Outbound, + z.ZodTypeDef, + AccountingBankAccountsOneRequest +> = z.object({ + id: z.string(), + consumerId: z.string().optional(), + appId: z.string().optional(), + serviceId: z.string().optional(), + raw: z.boolean().default(false), + fields: z.nullable(z.string()).optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AccountingBankAccountsOneRequest$ { + /** @deprecated use `AccountingBankAccountsOneRequest$inboundSchema` instead. */ + export const inboundSchema = AccountingBankAccountsOneRequest$inboundSchema; + /** @deprecated use `AccountingBankAccountsOneRequest$outboundSchema` instead. */ + export const outboundSchema = AccountingBankAccountsOneRequest$outboundSchema; + /** @deprecated use `AccountingBankAccountsOneRequest$Outbound` instead. */ + export type Outbound = AccountingBankAccountsOneRequest$Outbound; +} + +export function accountingBankAccountsOneRequestToJSON( + accountingBankAccountsOneRequest: AccountingBankAccountsOneRequest, +): string { + return JSON.stringify( + AccountingBankAccountsOneRequest$outboundSchema.parse( + accountingBankAccountsOneRequest, + ), + ); +} + +export function accountingBankAccountsOneRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AccountingBankAccountsOneRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AccountingBankAccountsOneRequest' from JSON`, + ); +} + +/** @internal */ +export const AccountingBankAccountsOneResponse$inboundSchema: z.ZodType< + AccountingBankAccountsOneResponse, + z.ZodTypeDef, + unknown +> = z.object({ + HttpMeta: components.HTTPMetadata$inboundSchema, + GetBankAccountResponse: components.GetBankAccountResponse$inboundSchema + .optional(), + UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema + .optional(), +}).transform((v) => { + return remap$(v, { + "HttpMeta": "httpMeta", + "GetBankAccountResponse": "getBankAccountResponse", + "UnexpectedErrorResponse": "unexpectedErrorResponse", + }); +}); + +/** @internal */ +export type AccountingBankAccountsOneResponse$Outbound = { + HttpMeta: components.HTTPMetadata$Outbound; + GetBankAccountResponse?: + | components.GetBankAccountResponse$Outbound + | undefined; + UnexpectedErrorResponse?: + | components.UnexpectedErrorResponse$Outbound + | undefined; +}; + +/** @internal */ +export const AccountingBankAccountsOneResponse$outboundSchema: z.ZodType< + AccountingBankAccountsOneResponse$Outbound, + z.ZodTypeDef, + AccountingBankAccountsOneResponse +> = z.object({ + httpMeta: components.HTTPMetadata$outboundSchema, + getBankAccountResponse: components.GetBankAccountResponse$outboundSchema + .optional(), + unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema + .optional(), +}).transform((v) => { + return remap$(v, { + httpMeta: "HttpMeta", + getBankAccountResponse: "GetBankAccountResponse", + unexpectedErrorResponse: "UnexpectedErrorResponse", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AccountingBankAccountsOneResponse$ { + /** @deprecated use `AccountingBankAccountsOneResponse$inboundSchema` instead. */ + export const inboundSchema = AccountingBankAccountsOneResponse$inboundSchema; + /** @deprecated use `AccountingBankAccountsOneResponse$outboundSchema` instead. */ + export const outboundSchema = + AccountingBankAccountsOneResponse$outboundSchema; + /** @deprecated use `AccountingBankAccountsOneResponse$Outbound` instead. */ + export type Outbound = AccountingBankAccountsOneResponse$Outbound; +} + +export function accountingBankAccountsOneResponseToJSON( + accountingBankAccountsOneResponse: AccountingBankAccountsOneResponse, +): string { + return JSON.stringify( + AccountingBankAccountsOneResponse$outboundSchema.parse( + accountingBankAccountsOneResponse, + ), + ); +} + +export function accountingBankAccountsOneResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AccountingBankAccountsOneResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AccountingBankAccountsOneResponse' from JSON`, + ); +} diff --git a/src/models/operations/accountingbankaccountsupdate.ts b/src/models/operations/accountingbankaccountsupdate.ts new file mode 100644 index 00000000..7297f77b --- /dev/null +++ b/src/models/operations/accountingbankaccountsupdate.ts @@ -0,0 +1,286 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as components from "../components/index.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type AccountingBankAccountsUpdateGlobals = { + /** + * ID of the consumer which you want to get or push data from + */ + consumerId?: string | undefined; + /** + * The ID of your Unify application + */ + appId?: string | undefined; +}; + +export type AccountingBankAccountsUpdateRequest = { + /** + * ID of the record you are acting upon. + */ + id: string; + /** + * ID of the consumer which you want to get or push data from + */ + consumerId?: string | undefined; + /** + * The ID of your Unify application + */ + appId?: string | undefined; + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + */ + serviceId?: string | undefined; + /** + * Include raw response. Mostly used for debugging purposes + */ + raw?: boolean | undefined; + accountingBankAccount: components.AccountingBankAccountInput; +}; + +export type AccountingBankAccountsUpdateResponse = { + httpMeta: components.HTTPMetadata; + /** + * Bank Account updated + */ + updateBankAccountResponse?: components.UpdateBankAccountResponse | undefined; + /** + * Unexpected error + */ + unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; +}; + +/** @internal */ +export const AccountingBankAccountsUpdateGlobals$inboundSchema: z.ZodType< + AccountingBankAccountsUpdateGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + consumerId: z.string().optional(), + appId: z.string().optional(), +}); + +/** @internal */ +export type AccountingBankAccountsUpdateGlobals$Outbound = { + consumerId?: string | undefined; + appId?: string | undefined; +}; + +/** @internal */ +export const AccountingBankAccountsUpdateGlobals$outboundSchema: z.ZodType< + AccountingBankAccountsUpdateGlobals$Outbound, + z.ZodTypeDef, + AccountingBankAccountsUpdateGlobals +> = z.object({ + consumerId: z.string().optional(), + appId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AccountingBankAccountsUpdateGlobals$ { + /** @deprecated use `AccountingBankAccountsUpdateGlobals$inboundSchema` instead. */ + export const inboundSchema = + AccountingBankAccountsUpdateGlobals$inboundSchema; + /** @deprecated use `AccountingBankAccountsUpdateGlobals$outboundSchema` instead. */ + export const outboundSchema = + AccountingBankAccountsUpdateGlobals$outboundSchema; + /** @deprecated use `AccountingBankAccountsUpdateGlobals$Outbound` instead. */ + export type Outbound = AccountingBankAccountsUpdateGlobals$Outbound; +} + +export function accountingBankAccountsUpdateGlobalsToJSON( + accountingBankAccountsUpdateGlobals: AccountingBankAccountsUpdateGlobals, +): string { + return JSON.stringify( + AccountingBankAccountsUpdateGlobals$outboundSchema.parse( + accountingBankAccountsUpdateGlobals, + ), + ); +} + +export function accountingBankAccountsUpdateGlobalsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + AccountingBankAccountsUpdateGlobals$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AccountingBankAccountsUpdateGlobals' from JSON`, + ); +} + +/** @internal */ +export const AccountingBankAccountsUpdateRequest$inboundSchema: z.ZodType< + AccountingBankAccountsUpdateRequest, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.string(), + consumerId: z.string().optional(), + appId: z.string().optional(), + serviceId: z.string().optional(), + raw: z.boolean().default(false), + AccountingBankAccount: components.AccountingBankAccountInput$inboundSchema, +}).transform((v) => { + return remap$(v, { + "AccountingBankAccount": "accountingBankAccount", + }); +}); + +/** @internal */ +export type AccountingBankAccountsUpdateRequest$Outbound = { + id: string; + consumerId?: string | undefined; + appId?: string | undefined; + serviceId?: string | undefined; + raw: boolean; + AccountingBankAccount: components.AccountingBankAccountInput$Outbound; +}; + +/** @internal */ +export const AccountingBankAccountsUpdateRequest$outboundSchema: z.ZodType< + AccountingBankAccountsUpdateRequest$Outbound, + z.ZodTypeDef, + AccountingBankAccountsUpdateRequest +> = z.object({ + id: z.string(), + consumerId: z.string().optional(), + appId: z.string().optional(), + serviceId: z.string().optional(), + raw: z.boolean().default(false), + accountingBankAccount: components.AccountingBankAccountInput$outboundSchema, +}).transform((v) => { + return remap$(v, { + accountingBankAccount: "AccountingBankAccount", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AccountingBankAccountsUpdateRequest$ { + /** @deprecated use `AccountingBankAccountsUpdateRequest$inboundSchema` instead. */ + export const inboundSchema = + AccountingBankAccountsUpdateRequest$inboundSchema; + /** @deprecated use `AccountingBankAccountsUpdateRequest$outboundSchema` instead. */ + export const outboundSchema = + AccountingBankAccountsUpdateRequest$outboundSchema; + /** @deprecated use `AccountingBankAccountsUpdateRequest$Outbound` instead. */ + export type Outbound = AccountingBankAccountsUpdateRequest$Outbound; +} + +export function accountingBankAccountsUpdateRequestToJSON( + accountingBankAccountsUpdateRequest: AccountingBankAccountsUpdateRequest, +): string { + return JSON.stringify( + AccountingBankAccountsUpdateRequest$outboundSchema.parse( + accountingBankAccountsUpdateRequest, + ), + ); +} + +export function accountingBankAccountsUpdateRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + AccountingBankAccountsUpdateRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AccountingBankAccountsUpdateRequest' from JSON`, + ); +} + +/** @internal */ +export const AccountingBankAccountsUpdateResponse$inboundSchema: z.ZodType< + AccountingBankAccountsUpdateResponse, + z.ZodTypeDef, + unknown +> = z.object({ + HttpMeta: components.HTTPMetadata$inboundSchema, + UpdateBankAccountResponse: components.UpdateBankAccountResponse$inboundSchema + .optional(), + UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema + .optional(), +}).transform((v) => { + return remap$(v, { + "HttpMeta": "httpMeta", + "UpdateBankAccountResponse": "updateBankAccountResponse", + "UnexpectedErrorResponse": "unexpectedErrorResponse", + }); +}); + +/** @internal */ +export type AccountingBankAccountsUpdateResponse$Outbound = { + HttpMeta: components.HTTPMetadata$Outbound; + UpdateBankAccountResponse?: + | components.UpdateBankAccountResponse$Outbound + | undefined; + UnexpectedErrorResponse?: + | components.UnexpectedErrorResponse$Outbound + | undefined; +}; + +/** @internal */ +export const AccountingBankAccountsUpdateResponse$outboundSchema: z.ZodType< + AccountingBankAccountsUpdateResponse$Outbound, + z.ZodTypeDef, + AccountingBankAccountsUpdateResponse +> = z.object({ + httpMeta: components.HTTPMetadata$outboundSchema, + updateBankAccountResponse: components.UpdateBankAccountResponse$outboundSchema + .optional(), + unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema + .optional(), +}).transform((v) => { + return remap$(v, { + httpMeta: "HttpMeta", + updateBankAccountResponse: "UpdateBankAccountResponse", + unexpectedErrorResponse: "UnexpectedErrorResponse", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AccountingBankAccountsUpdateResponse$ { + /** @deprecated use `AccountingBankAccountsUpdateResponse$inboundSchema` instead. */ + export const inboundSchema = + AccountingBankAccountsUpdateResponse$inboundSchema; + /** @deprecated use `AccountingBankAccountsUpdateResponse$outboundSchema` instead. */ + export const outboundSchema = + AccountingBankAccountsUpdateResponse$outboundSchema; + /** @deprecated use `AccountingBankAccountsUpdateResponse$Outbound` instead. */ + export type Outbound = AccountingBankAccountsUpdateResponse$Outbound; +} + +export function accountingBankAccountsUpdateResponseToJSON( + accountingBankAccountsUpdateResponse: AccountingBankAccountsUpdateResponse, +): string { + return JSON.stringify( + AccountingBankAccountsUpdateResponse$outboundSchema.parse( + accountingBankAccountsUpdateResponse, + ), + ); +} + +export function accountingBankAccountsUpdateResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + AccountingBankAccountsUpdateResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AccountingBankAccountsUpdateResponse' from JSON`, + ); +} diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index c37ff979..dd8c2fb6 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -10,6 +10,11 @@ export * from "./accountingattachmentsdownload.js"; export * from "./accountingattachmentsone.js"; export * from "./accountingattachmentsupload.js"; export * from "./accountingbalancesheetone.js"; +export * from "./accountingbankaccountsadd.js"; +export * from "./accountingbankaccountsall.js"; +export * from "./accountingbankaccountsdelete.js"; +export * from "./accountingbankaccountsone.js"; +export * from "./accountingbankaccountsupdate.js"; export * from "./accountingbankfeedaccountsadd.js"; export * from "./accountingbankfeedaccountsall.js"; export * from "./accountingbankfeedaccountsdelete.js"; diff --git a/src/sdk/accounting.ts b/src/sdk/accounting.ts index 3f28e09b..c27ae9f6 100644 --- a/src/sdk/accounting.ts +++ b/src/sdk/accounting.ts @@ -7,6 +7,7 @@ import { AgedCreditors } from "./agedcreditors.js"; import { AgedDebtors } from "./ageddebtors.js"; import { Attachments } from "./attachments.js"; import { BalanceSheet } from "./balancesheet.js"; +import { BankAccounts } from "./bankaccounts.js"; import { BankFeedAccounts } from "./bankfeedaccounts.js"; import { BankFeedStatements } from "./bankfeedstatements.js"; import { BillPayments } from "./billpayments.js"; @@ -122,6 +123,11 @@ export class Accounting extends ClientSDK { return (this._attachments ??= new Attachments(this._options)); } + private _bankAccounts?: BankAccounts; + get bankAccounts(): BankAccounts { + return (this._bankAccounts ??= new BankAccounts(this._options)); + } + private _trackingCategories?: TrackingCategories; get trackingCategories(): TrackingCategories { return (this._trackingCategories ??= new TrackingCategories(this._options)); diff --git a/src/sdk/bankaccounts.ts b/src/sdk/bankaccounts.ts new file mode 100644 index 00000000..7a6ba406 --- /dev/null +++ b/src/sdk/bankaccounts.ts @@ -0,0 +1,105 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { accountingBankAccountsCreate } from "../funcs/accountingBankAccountsCreate.js"; +import { accountingBankAccountsDelete } from "../funcs/accountingBankAccountsDelete.js"; +import { accountingBankAccountsGet } from "../funcs/accountingBankAccountsGet.js"; +import { accountingBankAccountsList } from "../funcs/accountingBankAccountsList.js"; +import { accountingBankAccountsUpdate } from "../funcs/accountingBankAccountsUpdate.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; +import { PageIterator, unwrapResultIterator } from "../types/operations.js"; + +export class BankAccounts extends ClientSDK { + /** + * List Bank Accounts + * + * @remarks + * List Bank Accounts + */ + async list( + request: operations.AccountingBankAccountsAllRequest, + options?: RequestOptions, + ): Promise< + PageIterator< + operations.AccountingBankAccountsAllResponse, + { cursor: string } + > + > { + return unwrapResultIterator(accountingBankAccountsList( + this, + request, + options, + )); + } + + /** + * Create Bank Account + * + * @remarks + * Create Bank Account + */ + async create( + request: operations.AccountingBankAccountsAddRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(accountingBankAccountsCreate( + this, + request, + options, + )); + } + + /** + * Get Bank Account + * + * @remarks + * Get Bank Account + */ + async get( + request: operations.AccountingBankAccountsOneRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(accountingBankAccountsGet( + this, + request, + options, + )); + } + + /** + * Update Bank Account + * + * @remarks + * Update Bank Account + */ + async update( + request: operations.AccountingBankAccountsUpdateRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(accountingBankAccountsUpdate( + this, + request, + options, + )); + } + + /** + * Delete Bank Account + * + * @remarks + * Delete Bank Account + */ + async delete( + request: operations.AccountingBankAccountsDeleteRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(accountingBankAccountsDelete( + this, + request, + options, + )); + } +}