diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 403069ee..6f6c3e52 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: fca0ac3a-5f4e-452c-bbc7-2311afa8da40 management: - docChecksum: 6d6e83d6bd6af93fdc92f2fa9028134b - docVersion: 10.18.0 - speakeasyVersion: 1.570.1 - generationVersion: 2.638.1 - releaseVersion: 0.19.0 - configChecksum: 13494ba0ba0c0f3e178dde2255f497be + docChecksum: 25c9b3bde8afc6d78e6a620449278477 + docVersion: 10.18.1 + speakeasyVersion: 1.580.0 + generationVersion: 2.654.2 + releaseVersion: 0.20.0 + configChecksum: 9b8d61e55653038e1963cc1e71e411e6 repoURL: https://github.com/apideck-libraries/sdk-python.git installationURL: https://github.com/apideck-libraries/sdk-python.git published: true @@ -15,7 +15,7 @@ features: acceptHeaders: 3.0.0 additionalDependencies: 1.0.0 constsAndDefaults: 1.0.5 - core: 5.19.3 + core: 5.19.4 deepObjectParams: 0.1.0 defaultEnabledRetries: 0.2.0 deprecations: 3.0.2 @@ -23,7 +23,7 @@ features: downloadStreams: 1.0.1 enumUnions: 0.1.0 envVarSecurityUsage: 0.3.2 - errors: 3.2.0 + errors: 3.3.1 flatRequests: 1.0.1 flattening: 3.1.1 globalSecurity: 3.0.3 @@ -35,7 +35,6 @@ features: inputOutputModels: 3.0.0 methodArguments: 1.0.2 methodServerURLs: 3.1.1 - mockServer: 0.1.0 nameOverrides: 3.0.1 nullables: 1.0.1 pagination: 3.0.5 @@ -50,7 +49,6 @@ generatedFiles: - .devcontainer/devcontainer.json - .devcontainer/setup.sh - .gitattributes - - .python-version - .vscode/settings.json - USAGE.md - docs/models/accountingagedcreditorsoneglobals.md @@ -469,6 +467,8 @@ generatedFiles: - docs/models/balancesheetliabilitiesaccount.md - docs/models/balancesheetuncategorizeditemsaccount.md - docs/models/bankaccount.md + - docs/models/bankaccount1.md + - docs/models/bankaccount1accounttype.md - docs/models/bankaccounttype.md - docs/models/bankfeedaccount.md - docs/models/bankfeedaccountinput.md @@ -509,9 +509,9 @@ generatedFiles: - docs/models/companiesfilter.md - docs/models/companiessort.md - docs/models/companiessortby.md - - docs/models/company.md + - docs/models/company1.md + - docs/models/company1input.md - docs/models/companyinfo.md - - docs/models/companyinput.md - docs/models/companyrowtype.md - docs/models/companystatus.md - docs/models/compensation.md @@ -2020,6 +2020,7 @@ generatedFiles: - src/apideck_unify/models/agedreportfilter.py - src/apideck_unify/models/allocation.py - src/apideck_unify/models/api.py + - src/apideck_unify/models/apideckerror.py - src/apideck_unify/models/apierror.py - src/apideck_unify/models/apiresource.py - src/apideck_unify/models/apiresourcecoverage.py @@ -2052,6 +2053,7 @@ generatedFiles: - src/apideck_unify/models/balancesheet.py - src/apideck_unify/models/balancesheetfilter.py - src/apideck_unify/models/bankaccount.py + - src/apideck_unify/models/bankaccount1.py - src/apideck_unify/models/bankfeedaccount.py - src/apideck_unify/models/bankfeedstatement.py - src/apideck_unify/models/benefit.py @@ -2071,7 +2073,7 @@ generatedFiles: - src/apideck_unify/models/commentssort.py - src/apideck_unify/models/companiesfilter.py - src/apideck_unify/models/companiessort.py - - src/apideck_unify/models/company.py + - src/apideck_unify/models/company1.py - src/apideck_unify/models/companyinfo.py - src/apideck_unify/models/compensation.py - src/apideck_unify/models/connection.py @@ -2567,6 +2569,7 @@ generatedFiles: - src/apideck_unify/models/logsfilter.py - src/apideck_unify/models/message.py - src/apideck_unify/models/meta.py + - src/apideck_unify/models/no_response_error.py - src/apideck_unify/models/note.py - src/apideck_unify/models/note_input.py - src/apideck_unify/models/notfoundresponse.py @@ -2608,6 +2611,7 @@ generatedFiles: - src/apideck_unify/models/purchaseorderssort.py - src/apideck_unify/models/requestcountallocation.py - src/apideck_unify/models/resourcestatus.py + - src/apideck_unify/models/responsevalidationerror.py - src/apideck_unify/models/schedule.py - src/apideck_unify/models/schemasupport.py - src/apideck_unify/models/security.py @@ -2774,891 +2778,13 @@ generatedFiles: - src/apideck_unify/utils/retries.py - src/apideck_unify/utils/security.py - src/apideck_unify/utils/serializers.py + - src/apideck_unify/utils/unmarshal_json_response.py - src/apideck_unify/utils/url.py - src/apideck_unify/utils/values.py - src/apideck_unify/validateconnection.py - src/apideck_unify/vault.py - src/apideck_unify/webhook_sdk.py - src/apideck_unify/webhooks.py - - tests/mockserver/.gitignore - - tests/mockserver/Dockerfile - - tests/mockserver/Makefile - - tests/mockserver/README.md - - tests/mockserver/go.mod - - tests/mockserver/go.sum - - tests/mockserver/internal/handler/assert/contenttype.go - - tests/mockserver/internal/handler/assert/header.go - - tests/mockserver/internal/handler/assert/parameter.go - - tests/mockserver/internal/handler/assert/pointer.go - - tests/mockserver/internal/handler/assert/security.go - - tests/mockserver/internal/handler/doc.go - - tests/mockserver/internal/handler/generated_handler.go - - tests/mockserver/internal/handler/generated_handlers.go - - tests/mockserver/internal/handler/values/files.go - - tests/mockserver/internal/logging/doc.go - - tests/mockserver/internal/logging/formats.go - - tests/mockserver/internal/logging/http_file.go - - tests/mockserver/internal/logging/http_logger.go - - tests/mockserver/internal/logging/levels.go - - tests/mockserver/internal/logging/logger.go - - tests/mockserver/internal/logging/oas_operation.go - - tests/mockserver/internal/logging/oas_operation_call.go - - tests/mockserver/internal/sdk/models/components/accountingdepartment.go - - tests/mockserver/internal/sdk/models/components/accountingdepartmentsfilter.go - - tests/mockserver/internal/sdk/models/components/accountinglocation.go - - tests/mockserver/internal/sdk/models/components/accountinglocationsfilter.go - - tests/mockserver/internal/sdk/models/components/activitiesfilter.go - - tests/mockserver/internal/sdk/models/components/activitiessort.go - - tests/mockserver/internal/sdk/models/components/activity.go - - tests/mockserver/internal/sdk/models/components/activityattendee.go - - tests/mockserver/internal/sdk/models/components/address.go - - tests/mockserver/internal/sdk/models/components/agedcreditors.go - - tests/mockserver/internal/sdk/models/components/ageddebtors.go - - tests/mockserver/internal/sdk/models/components/agedreportfilter.go - - tests/mockserver/internal/sdk/models/components/allocation.go - - tests/mockserver/internal/sdk/models/components/api.go - - tests/mockserver/internal/sdk/models/components/apiresource.go - - tests/mockserver/internal/sdk/models/components/apiresourcecoverage.go - - tests/mockserver/internal/sdk/models/components/apisfilter.go - - tests/mockserver/internal/sdk/models/components/apistatus.go - - tests/mockserver/internal/sdk/models/components/applicant.go - - tests/mockserver/internal/sdk/models/components/applicantsfilter.go - - tests/mockserver/internal/sdk/models/components/application.go - - tests/mockserver/internal/sdk/models/components/assignee.go - - tests/mockserver/internal/sdk/models/components/assigneeinput.go - - tests/mockserver/internal/sdk/models/components/attachment.go - - tests/mockserver/internal/sdk/models/components/attachmentreference.go - - tests/mockserver/internal/sdk/models/components/attachmentreferencetype.go - - tests/mockserver/internal/sdk/models/components/authtype.go - - tests/mockserver/internal/sdk/models/components/badrequestresponseerror.go - - tests/mockserver/internal/sdk/models/components/balancebyperiod.go - - tests/mockserver/internal/sdk/models/components/balancebytransaction.go - - tests/mockserver/internal/sdk/models/components/balancesheet.go - - tests/mockserver/internal/sdk/models/components/balancesheetfilter.go - - tests/mockserver/internal/sdk/models/components/bankaccount.go - - tests/mockserver/internal/sdk/models/components/bankfeedaccount.go - - tests/mockserver/internal/sdk/models/components/bankfeedstatement.go - - tests/mockserver/internal/sdk/models/components/benefit.go - - tests/mockserver/internal/sdk/models/components/bill.go - - tests/mockserver/internal/sdk/models/components/billlineitem.go - - tests/mockserver/internal/sdk/models/components/billpayment.go - - tests/mockserver/internal/sdk/models/components/billsfilter.go - - tests/mockserver/internal/sdk/models/components/billssort.go - - tests/mockserver/internal/sdk/models/components/category.go - - tests/mockserver/internal/sdk/models/components/collection.go - - tests/mockserver/internal/sdk/models/components/collectionssort.go - - tests/mockserver/internal/sdk/models/components/collectiontag.go - - tests/mockserver/internal/sdk/models/components/collectiontaginput.go - - tests/mockserver/internal/sdk/models/components/collectionticketcomment.go - - tests/mockserver/internal/sdk/models/components/collectionticketcommentinput.go - - tests/mockserver/internal/sdk/models/components/collectionuser.go - - tests/mockserver/internal/sdk/models/components/commentssort.go - - tests/mockserver/internal/sdk/models/components/companiesfilter.go - - tests/mockserver/internal/sdk/models/components/companiessort.go - - tests/mockserver/internal/sdk/models/components/company.go - - tests/mockserver/internal/sdk/models/components/companyinfo.go - - tests/mockserver/internal/sdk/models/components/compensation.go - - tests/mockserver/internal/sdk/models/components/connection.go - - tests/mockserver/internal/sdk/models/components/connectionimportdata.go - - tests/mockserver/internal/sdk/models/components/connectionstate.go - - tests/mockserver/internal/sdk/models/components/connector.go - - tests/mockserver/internal/sdk/models/components/connectordoc.go - - tests/mockserver/internal/sdk/models/components/connectorevent.go - - tests/mockserver/internal/sdk/models/components/connectorresource.go - - tests/mockserver/internal/sdk/models/components/connectorsetting.go - - tests/mockserver/internal/sdk/models/components/connectorsfilter.go - - tests/mockserver/internal/sdk/models/components/connectorstatus.go - - tests/mockserver/internal/sdk/models/components/consumer.go - - tests/mockserver/internal/sdk/models/components/consumerconnection.go - - tests/mockserver/internal/sdk/models/components/consumerinput.go - - tests/mockserver/internal/sdk/models/components/consumermetadata.go - - tests/mockserver/internal/sdk/models/components/consumerrequestcountsindaterangeresponse.go - - tests/mockserver/internal/sdk/models/components/contact.go - - tests/mockserver/internal/sdk/models/components/contactsfilter.go - - tests/mockserver/internal/sdk/models/components/contactssort.go - - tests/mockserver/internal/sdk/models/components/copyfolderrequest.go - - tests/mockserver/internal/sdk/models/components/createaccountingdepartmentresponse.go - - tests/mockserver/internal/sdk/models/components/createaccountinglocationresponse.go - - tests/mockserver/internal/sdk/models/components/createactivityresponse.go - - tests/mockserver/internal/sdk/models/components/createapplicantresponse.go - - tests/mockserver/internal/sdk/models/components/createapplicationresponse.go - - tests/mockserver/internal/sdk/models/components/createattachmentresponse.go - - tests/mockserver/internal/sdk/models/components/createbankfeedaccountresponse.go - - tests/mockserver/internal/sdk/models/components/createbankfeedstatementresponse.go - - tests/mockserver/internal/sdk/models/components/createbillpaymentresponse.go - - tests/mockserver/internal/sdk/models/components/createbillresponse.go - - tests/mockserver/internal/sdk/models/components/createcallbackstate.go - - tests/mockserver/internal/sdk/models/components/createcallbackstateresponse.go - - tests/mockserver/internal/sdk/models/components/createcommentresponse.go - - tests/mockserver/internal/sdk/models/components/createcompanyresponse.go - - tests/mockserver/internal/sdk/models/components/createconnectionresponse.go - - tests/mockserver/internal/sdk/models/components/createconsumerresponse.go - - tests/mockserver/internal/sdk/models/components/createcontactresponse.go - - tests/mockserver/internal/sdk/models/components/createcreditnoteresponse.go - - tests/mockserver/internal/sdk/models/components/createcustomerresponse.go - - tests/mockserver/internal/sdk/models/components/createcustomobjectresponse.go - - tests/mockserver/internal/sdk/models/components/createcustomobjectschemaresponse.go - - tests/mockserver/internal/sdk/models/components/createdepartmentresponse.go - - tests/mockserver/internal/sdk/models/components/createdrivegroupresponse.go - - tests/mockserver/internal/sdk/models/components/createdriveresponse.go - - tests/mockserver/internal/sdk/models/components/createemployeeresponse.go - - tests/mockserver/internal/sdk/models/components/createexpenseresponse.go - - tests/mockserver/internal/sdk/models/components/createfolderrequest.go - - tests/mockserver/internal/sdk/models/components/createfolderresponse.go - - tests/mockserver/internal/sdk/models/components/createhriscompanyresponse.go - - tests/mockserver/internal/sdk/models/components/createinvoiceitemresponse.go - - tests/mockserver/internal/sdk/models/components/createinvoiceresponse.go - - tests/mockserver/internal/sdk/models/components/createjournalentryresponse.go - - tests/mockserver/internal/sdk/models/components/createleadresponse.go - - tests/mockserver/internal/sdk/models/components/createledgeraccountresponse.go - - tests/mockserver/internal/sdk/models/components/createmessageresponse.go - - tests/mockserver/internal/sdk/models/components/createnoteresponse.go - - tests/mockserver/internal/sdk/models/components/createopportunityresponse.go - - tests/mockserver/internal/sdk/models/components/createpaymentresponse.go - - tests/mockserver/internal/sdk/models/components/createpipelineresponse.go - - tests/mockserver/internal/sdk/models/components/createpurchaseorderresponse.go - - tests/mockserver/internal/sdk/models/components/createsessionresponse.go - - tests/mockserver/internal/sdk/models/components/createsharedlinkresponse.go - - tests/mockserver/internal/sdk/models/components/createsubsidiaryresponse.go - - tests/mockserver/internal/sdk/models/components/createsupplierresponse.go - - tests/mockserver/internal/sdk/models/components/createtaxrateresponse.go - - tests/mockserver/internal/sdk/models/components/createticketresponse.go - - tests/mockserver/internal/sdk/models/components/createtimeoffrequestresponse.go - - tests/mockserver/internal/sdk/models/components/createtrackingcategoryresponse.go - - tests/mockserver/internal/sdk/models/components/createuploadsessionrequest.go - - tests/mockserver/internal/sdk/models/components/createuploadsessionresponse.go - - tests/mockserver/internal/sdk/models/components/createuserresponse.go - - tests/mockserver/internal/sdk/models/components/createwebhookrequest.go - - tests/mockserver/internal/sdk/models/components/createwebhookresponse.go - - tests/mockserver/internal/sdk/models/components/creditnote.go - - tests/mockserver/internal/sdk/models/components/creditnotesfilter.go - - tests/mockserver/internal/sdk/models/components/creditnotessort.go - - tests/mockserver/internal/sdk/models/components/creditordebit.go - - tests/mockserver/internal/sdk/models/components/currency.go - - tests/mockserver/internal/sdk/models/components/customer.go - - tests/mockserver/internal/sdk/models/components/customersfilter.go - - tests/mockserver/internal/sdk/models/components/customerssort.go - - tests/mockserver/internal/sdk/models/components/customfield.go - - tests/mockserver/internal/sdk/models/components/customfieldfinder.go - - tests/mockserver/internal/sdk/models/components/custommapping.go - - tests/mockserver/internal/sdk/models/components/custommappinginput.go - - tests/mockserver/internal/sdk/models/components/customobject.go - - tests/mockserver/internal/sdk/models/components/customobjectschema.go - - tests/mockserver/internal/sdk/models/components/deduction.go - - tests/mockserver/internal/sdk/models/components/deleteaccountingdepartmentresponse.go - - tests/mockserver/internal/sdk/models/components/deleteaccountinglocationresponse.go - - tests/mockserver/internal/sdk/models/components/deleteactivityresponse.go - - tests/mockserver/internal/sdk/models/components/deleteapplicantresponse.go - - tests/mockserver/internal/sdk/models/components/deleteapplicationresponse.go - - tests/mockserver/internal/sdk/models/components/deleteattachmentresponse.go - - tests/mockserver/internal/sdk/models/components/deletebankfeedaccountresponse.go - - tests/mockserver/internal/sdk/models/components/deletebankfeedstatementresponse.go - - tests/mockserver/internal/sdk/models/components/deletebillpaymentresponse.go - - tests/mockserver/internal/sdk/models/components/deletebillresponse.go - - tests/mockserver/internal/sdk/models/components/deletecommentresponse.go - - tests/mockserver/internal/sdk/models/components/deletecompanyresponse.go - - tests/mockserver/internal/sdk/models/components/deleteconsumerresponse.go - - tests/mockserver/internal/sdk/models/components/deletecontactresponse.go - - tests/mockserver/internal/sdk/models/components/deletecreditnoteresponse.go - - tests/mockserver/internal/sdk/models/components/deletecustomerresponse.go - - tests/mockserver/internal/sdk/models/components/deletecustomobjectresponse.go - - tests/mockserver/internal/sdk/models/components/deletecustomobjectschemaresponse.go - - tests/mockserver/internal/sdk/models/components/deletedepartmentresponse.go - - tests/mockserver/internal/sdk/models/components/deletedrivegroupresponse.go - - tests/mockserver/internal/sdk/models/components/deletedriveresponse.go - - tests/mockserver/internal/sdk/models/components/deleteemployeeresponse.go - - tests/mockserver/internal/sdk/models/components/deleteexpenseresponse.go - - tests/mockserver/internal/sdk/models/components/deletefileresponse.go - - tests/mockserver/internal/sdk/models/components/deletefolderresponse.go - - tests/mockserver/internal/sdk/models/components/deletehriscompanyresponse.go - - tests/mockserver/internal/sdk/models/components/deleteinvoiceresponse.go - - tests/mockserver/internal/sdk/models/components/deletejournalentryresponse.go - - tests/mockserver/internal/sdk/models/components/deleteleadresponse.go - - tests/mockserver/internal/sdk/models/components/deleteledgeraccountresponse.go - - tests/mockserver/internal/sdk/models/components/deletemessageresponse.go - - tests/mockserver/internal/sdk/models/components/deletenoteresponse.go - - tests/mockserver/internal/sdk/models/components/deleteopportunityresponse.go - - tests/mockserver/internal/sdk/models/components/deletepaymentresponse.go - - tests/mockserver/internal/sdk/models/components/deletepipelineresponse.go - - tests/mockserver/internal/sdk/models/components/deletepurchaseorderresponse.go - - tests/mockserver/internal/sdk/models/components/deletesharedlinkresponse.go - - tests/mockserver/internal/sdk/models/components/deletesubsidiaryresponse.go - - tests/mockserver/internal/sdk/models/components/deletesupplierresponse.go - - tests/mockserver/internal/sdk/models/components/deletetaxrateresponse.go - - tests/mockserver/internal/sdk/models/components/deleteticketresponse.go - - tests/mockserver/internal/sdk/models/components/deletetimeoffrequestresponse.go - - tests/mockserver/internal/sdk/models/components/deletetrackingcategoryresponse.go - - tests/mockserver/internal/sdk/models/components/deleteuploadsessionresponse.go - - tests/mockserver/internal/sdk/models/components/deleteuserresponse.go - - tests/mockserver/internal/sdk/models/components/deletewebhookresponse.go - - tests/mockserver/internal/sdk/models/components/department.go - - tests/mockserver/internal/sdk/models/components/departmentinput.go - - tests/mockserver/internal/sdk/models/components/deprecatedlinkedsupplier.go - - tests/mockserver/internal/sdk/models/components/deprecatedlinkedsupplierinput.go - - tests/mockserver/internal/sdk/models/components/deprecatedlinkedtrackingcategory.go - - tests/mockserver/internal/sdk/models/components/drive.go - - tests/mockserver/internal/sdk/models/components/drivegroup.go - - tests/mockserver/internal/sdk/models/components/drivegroupinput.go - - tests/mockserver/internal/sdk/models/components/drivegroupsfilter.go - - tests/mockserver/internal/sdk/models/components/driveinput.go - - tests/mockserver/internal/sdk/models/components/drivesfilter.go - - tests/mockserver/internal/sdk/models/components/ecommerceaddress.go - - tests/mockserver/internal/sdk/models/components/ecommercecustomer.go - - tests/mockserver/internal/sdk/models/components/ecommercecustomersfilter.go - - tests/mockserver/internal/sdk/models/components/ecommercediscount.go - - tests/mockserver/internal/sdk/models/components/ecommerceorder.go - - tests/mockserver/internal/sdk/models/components/ecommerceorderlineitem.go - - tests/mockserver/internal/sdk/models/components/ecommerceorderrefund.go - - tests/mockserver/internal/sdk/models/components/ecommerceordersfilter.go - - tests/mockserver/internal/sdk/models/components/ecommerceorderstatus.go - - tests/mockserver/internal/sdk/models/components/ecommerceproduct.go - - tests/mockserver/internal/sdk/models/components/ecommercestore.go - - tests/mockserver/internal/sdk/models/components/email.go - - tests/mockserver/internal/sdk/models/components/employee.go - - tests/mockserver/internal/sdk/models/components/employeecompensation.go - - tests/mockserver/internal/sdk/models/components/employeejob.go - - tests/mockserver/internal/sdk/models/components/employeepayroll.go - - tests/mockserver/internal/sdk/models/components/employeeschedules.go - - tests/mockserver/internal/sdk/models/components/employeesfilter.go - - tests/mockserver/internal/sdk/models/components/employeesonefilter.go - - tests/mockserver/internal/sdk/models/components/employeessort.go - - tests/mockserver/internal/sdk/models/components/employmentstatus.go - - tests/mockserver/internal/sdk/models/components/expense.go - - tests/mockserver/internal/sdk/models/components/expenselineitem.go - - tests/mockserver/internal/sdk/models/components/expenselineiteminput.go - - tests/mockserver/internal/sdk/models/components/filesfilter.go - - tests/mockserver/internal/sdk/models/components/filessearch.go - - tests/mockserver/internal/sdk/models/components/filessort.go - - tests/mockserver/internal/sdk/models/components/filetype.go - - tests/mockserver/internal/sdk/models/components/folder.go - - tests/mockserver/internal/sdk/models/components/formfield.go - - tests/mockserver/internal/sdk/models/components/formfieldoption.go - - tests/mockserver/internal/sdk/models/components/formfieldoptiongroup.go - - tests/mockserver/internal/sdk/models/components/gender.go - - tests/mockserver/internal/sdk/models/components/getaccountingdepartmentresponse.go - - tests/mockserver/internal/sdk/models/components/getaccountingdepartmentsresponse.go - - tests/mockserver/internal/sdk/models/components/getaccountinglocationresponse.go - - tests/mockserver/internal/sdk/models/components/getaccountinglocationsresponse.go - - tests/mockserver/internal/sdk/models/components/getactivitiesresponse.go - - tests/mockserver/internal/sdk/models/components/getactivityresponse.go - - tests/mockserver/internal/sdk/models/components/getagedcreditorsresponse.go - - tests/mockserver/internal/sdk/models/components/getageddebtorsresponse.go - - tests/mockserver/internal/sdk/models/components/getapiresourcecoverageresponse.go - - tests/mockserver/internal/sdk/models/components/getapiresourceresponse.go - - tests/mockserver/internal/sdk/models/components/getapiresponse.go - - tests/mockserver/internal/sdk/models/components/getapisresponse.go - - tests/mockserver/internal/sdk/models/components/getapplicantresponse.go - - tests/mockserver/internal/sdk/models/components/getapplicantsresponse.go - - tests/mockserver/internal/sdk/models/components/getapplicationresponse.go - - tests/mockserver/internal/sdk/models/components/getapplicationsresponse.go - - tests/mockserver/internal/sdk/models/components/getattachmentresponse.go - - tests/mockserver/internal/sdk/models/components/getattachmentsresponse.go - - tests/mockserver/internal/sdk/models/components/getbalancesheetresponse.go - - tests/mockserver/internal/sdk/models/components/getbankfeedaccountresponse.go - - tests/mockserver/internal/sdk/models/components/getbankfeedaccountsresponse.go - - tests/mockserver/internal/sdk/models/components/getbankfeedstatementresponse.go - - tests/mockserver/internal/sdk/models/components/getbankfeedstatementsresponse.go - - tests/mockserver/internal/sdk/models/components/getbillpaymentresponse.go - - tests/mockserver/internal/sdk/models/components/getbillpaymentsresponse.go - - tests/mockserver/internal/sdk/models/components/getbillresponse.go - - tests/mockserver/internal/sdk/models/components/getbillsresponse.go - - tests/mockserver/internal/sdk/models/components/getcategoriesresponse.go - - tests/mockserver/internal/sdk/models/components/getcategoryresponse.go - - tests/mockserver/internal/sdk/models/components/getcollectionresponse.go - - tests/mockserver/internal/sdk/models/components/getcollectionsresponse.go - - tests/mockserver/internal/sdk/models/components/getcollectiontagsresponse.go - - tests/mockserver/internal/sdk/models/components/getcollectionuserresponse.go - - tests/mockserver/internal/sdk/models/components/getcollectionusersresponse.go - - tests/mockserver/internal/sdk/models/components/getcommentresponse.go - - tests/mockserver/internal/sdk/models/components/getcommentsresponse.go - - tests/mockserver/internal/sdk/models/components/getcompaniesresponse.go - - tests/mockserver/internal/sdk/models/components/getcompanyinforesponse.go - - tests/mockserver/internal/sdk/models/components/getcompanyresponse.go - - tests/mockserver/internal/sdk/models/components/getconnectionresponse.go - - tests/mockserver/internal/sdk/models/components/getconnectionsresponse.go - - tests/mockserver/internal/sdk/models/components/getconnectorresourceresponse.go - - tests/mockserver/internal/sdk/models/components/getconnectorresponse.go - - tests/mockserver/internal/sdk/models/components/getconnectorsresponse.go - - tests/mockserver/internal/sdk/models/components/getconsumerresponse.go - - tests/mockserver/internal/sdk/models/components/getconsumersresponse.go - - tests/mockserver/internal/sdk/models/components/getcontactresponse.go - - tests/mockserver/internal/sdk/models/components/getcontactsresponse.go - - tests/mockserver/internal/sdk/models/components/getcreditnoteresponse.go - - tests/mockserver/internal/sdk/models/components/getcreditnotesresponse.go - - tests/mockserver/internal/sdk/models/components/getcustomerresponse.go - - tests/mockserver/internal/sdk/models/components/getcustomersresponse.go - - tests/mockserver/internal/sdk/models/components/getcustomfieldsresponse.go - - tests/mockserver/internal/sdk/models/components/getcustommappingsresponse.go - - tests/mockserver/internal/sdk/models/components/getcustomobjectresponse.go - - tests/mockserver/internal/sdk/models/components/getcustomobjectschemaresponse.go - - tests/mockserver/internal/sdk/models/components/getcustomobjectschemasresponse.go - - tests/mockserver/internal/sdk/models/components/getcustomobjectsresponse.go - - tests/mockserver/internal/sdk/models/components/getdepartmentresponse.go - - tests/mockserver/internal/sdk/models/components/getdepartmentsresponse.go - - tests/mockserver/internal/sdk/models/components/getdrivegroupresponse.go - - tests/mockserver/internal/sdk/models/components/getdrivegroupsresponse.go - - tests/mockserver/internal/sdk/models/components/getdriveresponse.go - - tests/mockserver/internal/sdk/models/components/getdrivesresponse.go - - tests/mockserver/internal/sdk/models/components/getecommercecustomerresponse.go - - tests/mockserver/internal/sdk/models/components/getecommercecustomersresponse.go - - tests/mockserver/internal/sdk/models/components/getecommerceorderresponse.go - - tests/mockserver/internal/sdk/models/components/getecommerceordersresponse.go - - tests/mockserver/internal/sdk/models/components/getemployeepayrollresponse.go - - tests/mockserver/internal/sdk/models/components/getemployeepayrollsresponse.go - - tests/mockserver/internal/sdk/models/components/getemployeeresponse.go - - tests/mockserver/internal/sdk/models/components/getemployeeschedulesresponse.go - - tests/mockserver/internal/sdk/models/components/getemployeesresponse.go - - tests/mockserver/internal/sdk/models/components/getexpenseresponse.go - - tests/mockserver/internal/sdk/models/components/getexpensesresponse.go - - tests/mockserver/internal/sdk/models/components/getfileresponse.go - - tests/mockserver/internal/sdk/models/components/getfilesresponse.go - - tests/mockserver/internal/sdk/models/components/getfolderresponse.go - - tests/mockserver/internal/sdk/models/components/gethriscompaniesresponse.go - - tests/mockserver/internal/sdk/models/components/gethriscompanyresponse.go - - tests/mockserver/internal/sdk/models/components/getinvoiceitemresponse.go - - tests/mockserver/internal/sdk/models/components/getinvoiceitemsresponse.go - - tests/mockserver/internal/sdk/models/components/getinvoiceresponse.go - - tests/mockserver/internal/sdk/models/components/getinvoicesresponse.go - - tests/mockserver/internal/sdk/models/components/getjobresponse.go - - tests/mockserver/internal/sdk/models/components/getjobsresponse.go - - tests/mockserver/internal/sdk/models/components/getjournalentriesresponse.go - - tests/mockserver/internal/sdk/models/components/getjournalentryresponse.go - - tests/mockserver/internal/sdk/models/components/getleadresponse.go - - tests/mockserver/internal/sdk/models/components/getleadsresponse.go - - tests/mockserver/internal/sdk/models/components/getledgeraccountresponse.go - - tests/mockserver/internal/sdk/models/components/getledgeraccountsresponse.go - - tests/mockserver/internal/sdk/models/components/getlogsresponse.go - - tests/mockserver/internal/sdk/models/components/getmessageresponse.go - - tests/mockserver/internal/sdk/models/components/getmessagesresponse.go - - tests/mockserver/internal/sdk/models/components/getnoteresponse.go - - tests/mockserver/internal/sdk/models/components/getnotesresponse.go - - tests/mockserver/internal/sdk/models/components/getopportunitiesresponse.go - - tests/mockserver/internal/sdk/models/components/getopportunityresponse.go - - tests/mockserver/internal/sdk/models/components/getpaymentresponse.go - - tests/mockserver/internal/sdk/models/components/getpaymentsresponse.go - - tests/mockserver/internal/sdk/models/components/getpayrollresponse.go - - tests/mockserver/internal/sdk/models/components/getpayrollsresponse.go - - tests/mockserver/internal/sdk/models/components/getpipelineresponse.go - - tests/mockserver/internal/sdk/models/components/getpipelinesresponse.go - - tests/mockserver/internal/sdk/models/components/getproductresponse.go - - tests/mockserver/internal/sdk/models/components/getproductsresponse.go - - tests/mockserver/internal/sdk/models/components/getprofitandlossresponse.go - - tests/mockserver/internal/sdk/models/components/getpurchaseorderresponse.go - - tests/mockserver/internal/sdk/models/components/getpurchaseordersresponse.go - - tests/mockserver/internal/sdk/models/components/getsharedlinkresponse.go - - tests/mockserver/internal/sdk/models/components/getsharedlinksresponse.go - - tests/mockserver/internal/sdk/models/components/getstoreresponse.go - - tests/mockserver/internal/sdk/models/components/getsubsidiariesresponse.go - - tests/mockserver/internal/sdk/models/components/getsubsidiaryresponse.go - - tests/mockserver/internal/sdk/models/components/getsupplierresponse.go - - tests/mockserver/internal/sdk/models/components/getsuppliersresponse.go - - tests/mockserver/internal/sdk/models/components/gettaxrateresponse.go - - tests/mockserver/internal/sdk/models/components/gettaxratesresponse.go - - tests/mockserver/internal/sdk/models/components/getticketresponse.go - - tests/mockserver/internal/sdk/models/components/getticketsresponse.go - - tests/mockserver/internal/sdk/models/components/gettimeoffrequestresponse.go - - tests/mockserver/internal/sdk/models/components/gettimeoffrequestsresponse.go - - tests/mockserver/internal/sdk/models/components/gettrackingcategoriesresponse.go - - tests/mockserver/internal/sdk/models/components/gettrackingcategoryresponse.go - - tests/mockserver/internal/sdk/models/components/getuploadsessionresponse.go - - tests/mockserver/internal/sdk/models/components/getuserresponse.go - - tests/mockserver/internal/sdk/models/components/getusersresponse.go - - tests/mockserver/internal/sdk/models/components/getwebhookeventlogsresponse.go - - tests/mockserver/internal/sdk/models/components/getwebhookresponse.go - - tests/mockserver/internal/sdk/models/components/getwebhooksresponse.go - - tests/mockserver/internal/sdk/models/components/hriscompany.go - - tests/mockserver/internal/sdk/models/components/httpmetadata.go - - tests/mockserver/internal/sdk/models/components/integrationstate.go - - tests/mockserver/internal/sdk/models/components/invoice.go - - tests/mockserver/internal/sdk/models/components/invoiceitem.go - - tests/mockserver/internal/sdk/models/components/invoiceitemfilter.go - - tests/mockserver/internal/sdk/models/components/invoiceitemsfilter.go - - tests/mockserver/internal/sdk/models/components/invoiceitemssort.go - - tests/mockserver/internal/sdk/models/components/invoicelineitem.go - - tests/mockserver/internal/sdk/models/components/invoiceresponse.go - - tests/mockserver/internal/sdk/models/components/invoicesfilter.go - - tests/mockserver/internal/sdk/models/components/invoicessort.go - - tests/mockserver/internal/sdk/models/components/issuesfilter.go - - tests/mockserver/internal/sdk/models/components/job.go - - tests/mockserver/internal/sdk/models/components/jobstatus.go - - tests/mockserver/internal/sdk/models/components/journalentriesfilter.go - - tests/mockserver/internal/sdk/models/components/journalentriessort.go - - tests/mockserver/internal/sdk/models/components/journalentry.go - - tests/mockserver/internal/sdk/models/components/journalentrylineitem.go - - tests/mockserver/internal/sdk/models/components/lead.go - - tests/mockserver/internal/sdk/models/components/leadinput.go - - tests/mockserver/internal/sdk/models/components/leadsfilter.go - - tests/mockserver/internal/sdk/models/components/leadssort.go - - tests/mockserver/internal/sdk/models/components/ledgeraccount.go - - tests/mockserver/internal/sdk/models/components/ledgeraccountsfilter.go - - tests/mockserver/internal/sdk/models/components/ledgeraccountssort.go - - tests/mockserver/internal/sdk/models/components/linkedconnectorresource.go - - tests/mockserver/internal/sdk/models/components/linkedcustomer.go - - tests/mockserver/internal/sdk/models/components/linkedcustomerinput.go - - tests/mockserver/internal/sdk/models/components/linkedecommercecustomer.go - - tests/mockserver/internal/sdk/models/components/linkedecommerceorder.go - - tests/mockserver/internal/sdk/models/components/linkedfolder.go - - tests/mockserver/internal/sdk/models/components/linkedinvoiceitem.go - - tests/mockserver/internal/sdk/models/components/linkedledgeraccount.go - - tests/mockserver/internal/sdk/models/components/linkedledgeraccountinput.go - - tests/mockserver/internal/sdk/models/components/linkedparentcustomer.go - - tests/mockserver/internal/sdk/models/components/linkedsupplier.go - - tests/mockserver/internal/sdk/models/components/linkedsupplierinput.go - - tests/mockserver/internal/sdk/models/components/linkedtaxrate.go - - tests/mockserver/internal/sdk/models/components/linkedtaxrateinput.go - - tests/mockserver/internal/sdk/models/components/linkedtrackingcategory.go - - tests/mockserver/internal/sdk/models/components/links.go - - tests/mockserver/internal/sdk/models/components/log.go - - tests/mockserver/internal/sdk/models/components/logsfilter.go - - tests/mockserver/internal/sdk/models/components/message.go - - tests/mockserver/internal/sdk/models/components/meta.go - - tests/mockserver/internal/sdk/models/components/note.go - - tests/mockserver/internal/sdk/models/components/noteinput.go - - tests/mockserver/internal/sdk/models/components/notfoundresponseerror.go - - tests/mockserver/internal/sdk/models/components/oauthgranttype.go - - tests/mockserver/internal/sdk/models/components/opportunitiesfilter.go - - tests/mockserver/internal/sdk/models/components/opportunitiessort.go - - tests/mockserver/internal/sdk/models/components/opportunity.go - - tests/mockserver/internal/sdk/models/components/opportunityinput.go - - tests/mockserver/internal/sdk/models/components/orderssort.go - - tests/mockserver/internal/sdk/models/components/outstandingbalancebycurrency.go - - tests/mockserver/internal/sdk/models/components/outstandingbalancebycustomer.go - - tests/mockserver/internal/sdk/models/components/outstandingbalancebysupplier.go - - tests/mockserver/internal/sdk/models/components/owner.go - - tests/mockserver/internal/sdk/models/components/paginationcoverage.go - - tests/mockserver/internal/sdk/models/components/passthroughbody.go - - tests/mockserver/internal/sdk/models/components/payment.go - - tests/mockserver/internal/sdk/models/components/paymentfrequency.go - - tests/mockserver/internal/sdk/models/components/paymentinput.go - - tests/mockserver/internal/sdk/models/components/paymentsfilter.go - - tests/mockserver/internal/sdk/models/components/paymentssort.go - - tests/mockserver/internal/sdk/models/components/paymentstatus.go - - tests/mockserver/internal/sdk/models/components/paymenttype.go - - tests/mockserver/internal/sdk/models/components/paymentunit.go - - tests/mockserver/internal/sdk/models/components/payroll.go - - tests/mockserver/internal/sdk/models/components/payrollsfilter.go - - tests/mockserver/internal/sdk/models/components/payrolltotals.go - - tests/mockserver/internal/sdk/models/components/person.go - - tests/mockserver/internal/sdk/models/components/personinput.go - - tests/mockserver/internal/sdk/models/components/phonenumber.go - - tests/mockserver/internal/sdk/models/components/pipeline.go - - tests/mockserver/internal/sdk/models/components/pipelineinput.go - - tests/mockserver/internal/sdk/models/components/profitandloss.go - - tests/mockserver/internal/sdk/models/components/profitandlossfilter.go - - tests/mockserver/internal/sdk/models/components/profitandlossindicator.go - - tests/mockserver/internal/sdk/models/components/profitandlosstype.go - - tests/mockserver/internal/sdk/models/components/purchaseorder.go - - tests/mockserver/internal/sdk/models/components/purchaseordersfilter.go - - tests/mockserver/internal/sdk/models/components/purchaseorderssort.go - - tests/mockserver/internal/sdk/models/components/requestcountallocation.go - - tests/mockserver/internal/sdk/models/components/resourcestatus.go - - tests/mockserver/internal/sdk/models/components/schedule.go - - tests/mockserver/internal/sdk/models/components/schemasupport.go - - tests/mockserver/internal/sdk/models/components/security.go - - tests/mockserver/internal/sdk/models/components/session.go - - tests/mockserver/internal/sdk/models/components/sharedlinkoutput.go - - tests/mockserver/internal/sdk/models/components/sharedlinktarget.go - - tests/mockserver/internal/sdk/models/components/simpleformfieldoption.go - - tests/mockserver/internal/sdk/models/components/sociallink.go - - tests/mockserver/internal/sdk/models/components/sortdirection.go - - tests/mockserver/internal/sdk/models/components/status.go - - tests/mockserver/internal/sdk/models/components/subsidiary.go - - tests/mockserver/internal/sdk/models/components/subsidiaryreference.go - - tests/mockserver/internal/sdk/models/components/subsidiaryreferenceinput.go - - tests/mockserver/internal/sdk/models/components/supplier.go - - tests/mockserver/internal/sdk/models/components/suppliersfilter.go - - tests/mockserver/internal/sdk/models/components/supplierssort.go - - tests/mockserver/internal/sdk/models/components/supportedproperty.go - - tests/mockserver/internal/sdk/models/components/tax.go - - tests/mockserver/internal/sdk/models/components/taxrate.go - - tests/mockserver/internal/sdk/models/components/taxratesfilter.go - - tests/mockserver/internal/sdk/models/components/team.go - - tests/mockserver/internal/sdk/models/components/ticket.go - - tests/mockserver/internal/sdk/models/components/ticketssort.go - - tests/mockserver/internal/sdk/models/components/timeoffrequest.go - - tests/mockserver/internal/sdk/models/components/timeoffrequestsfilter.go - - tests/mockserver/internal/sdk/models/components/trackingcategory.go - - tests/mockserver/internal/sdk/models/components/trackingitem.go - - tests/mockserver/internal/sdk/models/components/unauthorizedresponseerror.go - - tests/mockserver/internal/sdk/models/components/unexpectederrorresponse.go - - tests/mockserver/internal/sdk/models/components/unifiedapiid.go - - tests/mockserver/internal/sdk/models/components/unifiedfile.go - - tests/mockserver/internal/sdk/models/components/unifiedid.go - - tests/mockserver/internal/sdk/models/components/unprocessableresponseerror.go - - tests/mockserver/internal/sdk/models/components/updateaccountingdepartmentresponse.go - - tests/mockserver/internal/sdk/models/components/updateaccountinglocationresponse.go - - tests/mockserver/internal/sdk/models/components/updateactivityresponse.go - - tests/mockserver/internal/sdk/models/components/updateapplicantresponse.go - - tests/mockserver/internal/sdk/models/components/updateapplicationresponse.go - - tests/mockserver/internal/sdk/models/components/updatebankfeedaccountresponse.go - - tests/mockserver/internal/sdk/models/components/updatebankfeedstatementresponse.go - - tests/mockserver/internal/sdk/models/components/updatebillpaymentresponse.go - - tests/mockserver/internal/sdk/models/components/updatebillresponse.go - - tests/mockserver/internal/sdk/models/components/updatecommentresponse.go - - tests/mockserver/internal/sdk/models/components/updatecompanyresponse.go - - tests/mockserver/internal/sdk/models/components/updateconnectionresponse.go - - tests/mockserver/internal/sdk/models/components/updateconsumerrequest.go - - tests/mockserver/internal/sdk/models/components/updateconsumerresponse.go - - tests/mockserver/internal/sdk/models/components/updatecontactresponse.go - - tests/mockserver/internal/sdk/models/components/updatecreditnoteresponse.go - - tests/mockserver/internal/sdk/models/components/updatecustomerresponse.go - - tests/mockserver/internal/sdk/models/components/updatecustomobjectresponse.go - - tests/mockserver/internal/sdk/models/components/updatecustomobjectschemaresponse.go - - tests/mockserver/internal/sdk/models/components/updatedepartmentresponse.go - - tests/mockserver/internal/sdk/models/components/updatedrivegroupresponse.go - - tests/mockserver/internal/sdk/models/components/updatedriveresponse.go - - tests/mockserver/internal/sdk/models/components/updateemployeeresponse.go - - tests/mockserver/internal/sdk/models/components/updateexpenseresponse.go - - tests/mockserver/internal/sdk/models/components/updatefilerequest.go - - tests/mockserver/internal/sdk/models/components/updatefileresponse.go - - tests/mockserver/internal/sdk/models/components/updatefolderrequest.go - - tests/mockserver/internal/sdk/models/components/updatefolderresponse.go - - tests/mockserver/internal/sdk/models/components/updatehriscompanyresponse.go - - tests/mockserver/internal/sdk/models/components/updateinvoiceitemsresponse.go - - tests/mockserver/internal/sdk/models/components/updateinvoiceresponse.go - - tests/mockserver/internal/sdk/models/components/updatejournalentryresponse.go - - tests/mockserver/internal/sdk/models/components/updateleadresponse.go - - tests/mockserver/internal/sdk/models/components/updateledgeraccountresponse.go - - tests/mockserver/internal/sdk/models/components/updatemessageresponse.go - - tests/mockserver/internal/sdk/models/components/updatenoteresponse.go - - tests/mockserver/internal/sdk/models/components/updateopportunityresponse.go - - tests/mockserver/internal/sdk/models/components/updatepaymentresponse.go - - tests/mockserver/internal/sdk/models/components/updatepipelineresponse.go - - tests/mockserver/internal/sdk/models/components/updatepurchaseorderresponse.go - - tests/mockserver/internal/sdk/models/components/updatesharedlinkresponse.go - - tests/mockserver/internal/sdk/models/components/updatesubsidiaryresponse.go - - tests/mockserver/internal/sdk/models/components/updatesupplierresponse.go - - tests/mockserver/internal/sdk/models/components/updatetaxrateresponse.go - - tests/mockserver/internal/sdk/models/components/updateticketresponse.go - - tests/mockserver/internal/sdk/models/components/updatetimeoffrequestresponse.go - - tests/mockserver/internal/sdk/models/components/updatetrackingcategoryresponse.go - - tests/mockserver/internal/sdk/models/components/updateuploadsessionresponse.go - - tests/mockserver/internal/sdk/models/components/updateuserresponse.go - - tests/mockserver/internal/sdk/models/components/updatewebhookrequest.go - - tests/mockserver/internal/sdk/models/components/updatewebhookresponse.go - - tests/mockserver/internal/sdk/models/components/uploadsession.go - - tests/mockserver/internal/sdk/models/components/userinput.go - - tests/mockserver/internal/sdk/models/components/useroutput.go - - tests/mockserver/internal/sdk/models/components/validateconnectionstateresponse.go - - tests/mockserver/internal/sdk/models/components/webhook.go - - tests/mockserver/internal/sdk/models/components/webhookeventlog.go - - tests/mockserver/internal/sdk/models/components/webhookeventlogsfilter.go - - tests/mockserver/internal/sdk/models/components/webhookeventtype.go - - tests/mockserver/internal/sdk/models/components/webhooksubscription.go - - tests/mockserver/internal/sdk/models/components/webhooksupport.go - - tests/mockserver/internal/sdk/models/components/website.go - - tests/mockserver/internal/sdk/models/operations/accountingagedcreditorsone.go - - tests/mockserver/internal/sdk/models/operations/accountingageddebtorsone.go - - tests/mockserver/internal/sdk/models/operations/accountingattachmentsall.go - - tests/mockserver/internal/sdk/models/operations/accountingattachmentsdelete.go - - tests/mockserver/internal/sdk/models/operations/accountingattachmentsdownload.go - - tests/mockserver/internal/sdk/models/operations/accountingattachmentsone.go - - tests/mockserver/internal/sdk/models/operations/accountingattachmentsupload.go - - tests/mockserver/internal/sdk/models/operations/accountingbalancesheetone.go - - tests/mockserver/internal/sdk/models/operations/accountingbankfeedaccountsadd.go - - tests/mockserver/internal/sdk/models/operations/accountingbankfeedaccountsall.go - - tests/mockserver/internal/sdk/models/operations/accountingbankfeedaccountsdelete.go - - tests/mockserver/internal/sdk/models/operations/accountingbankfeedaccountsone.go - - tests/mockserver/internal/sdk/models/operations/accountingbankfeedaccountsupdate.go - - tests/mockserver/internal/sdk/models/operations/accountingbankfeedstatementsadd.go - - tests/mockserver/internal/sdk/models/operations/accountingbankfeedstatementsall.go - - tests/mockserver/internal/sdk/models/operations/accountingbankfeedstatementsdelete.go - - tests/mockserver/internal/sdk/models/operations/accountingbankfeedstatementsone.go - - tests/mockserver/internal/sdk/models/operations/accountingbankfeedstatementsupdate.go - - tests/mockserver/internal/sdk/models/operations/accountingbillpaymentsadd.go - - tests/mockserver/internal/sdk/models/operations/accountingbillpaymentsall.go - - tests/mockserver/internal/sdk/models/operations/accountingbillpaymentsdelete.go - - tests/mockserver/internal/sdk/models/operations/accountingbillpaymentsone.go - - tests/mockserver/internal/sdk/models/operations/accountingbillpaymentsupdate.go - - tests/mockserver/internal/sdk/models/operations/accountingbillsadd.go - - tests/mockserver/internal/sdk/models/operations/accountingbillsall.go - - tests/mockserver/internal/sdk/models/operations/accountingbillsdelete.go - - tests/mockserver/internal/sdk/models/operations/accountingbillsone.go - - tests/mockserver/internal/sdk/models/operations/accountingbillsupdate.go - - tests/mockserver/internal/sdk/models/operations/accountingcategoriesall.go - - tests/mockserver/internal/sdk/models/operations/accountingcategoriesone.go - - tests/mockserver/internal/sdk/models/operations/accountingcompanyinfoone.go - - tests/mockserver/internal/sdk/models/operations/accountingcreditnotesadd.go - - tests/mockserver/internal/sdk/models/operations/accountingcreditnotesall.go - - tests/mockserver/internal/sdk/models/operations/accountingcreditnotesdelete.go - - tests/mockserver/internal/sdk/models/operations/accountingcreditnotesone.go - - tests/mockserver/internal/sdk/models/operations/accountingcreditnotesupdate.go - - tests/mockserver/internal/sdk/models/operations/accountingcustomersadd.go - - tests/mockserver/internal/sdk/models/operations/accountingcustomersall.go - - tests/mockserver/internal/sdk/models/operations/accountingcustomersdelete.go - - tests/mockserver/internal/sdk/models/operations/accountingcustomersone.go - - tests/mockserver/internal/sdk/models/operations/accountingcustomersupdate.go - - tests/mockserver/internal/sdk/models/operations/accountingdepartmentsadd.go - - tests/mockserver/internal/sdk/models/operations/accountingdepartmentsall.go - - tests/mockserver/internal/sdk/models/operations/accountingdepartmentsdelete.go - - tests/mockserver/internal/sdk/models/operations/accountingdepartmentsone.go - - tests/mockserver/internal/sdk/models/operations/accountingdepartmentsupdate.go - - tests/mockserver/internal/sdk/models/operations/accountingexpensesadd.go - - tests/mockserver/internal/sdk/models/operations/accountingexpensesall.go - - tests/mockserver/internal/sdk/models/operations/accountingexpensesdelete.go - - tests/mockserver/internal/sdk/models/operations/accountingexpensesone.go - - tests/mockserver/internal/sdk/models/operations/accountingexpensesupdate.go - - tests/mockserver/internal/sdk/models/operations/accountinginvoiceitemsadd.go - - tests/mockserver/internal/sdk/models/operations/accountinginvoiceitemsall.go - - tests/mockserver/internal/sdk/models/operations/accountinginvoiceitemsdelete.go - - tests/mockserver/internal/sdk/models/operations/accountinginvoiceitemsone.go - - tests/mockserver/internal/sdk/models/operations/accountinginvoiceitemsupdate.go - - tests/mockserver/internal/sdk/models/operations/accountinginvoicesadd.go - - tests/mockserver/internal/sdk/models/operations/accountinginvoicesall.go - - tests/mockserver/internal/sdk/models/operations/accountinginvoicesdelete.go - - tests/mockserver/internal/sdk/models/operations/accountinginvoicesone.go - - tests/mockserver/internal/sdk/models/operations/accountinginvoicesupdate.go - - tests/mockserver/internal/sdk/models/operations/accountingjournalentriesadd.go - - tests/mockserver/internal/sdk/models/operations/accountingjournalentriesall.go - - tests/mockserver/internal/sdk/models/operations/accountingjournalentriesdelete.go - - tests/mockserver/internal/sdk/models/operations/accountingjournalentriesone.go - - tests/mockserver/internal/sdk/models/operations/accountingjournalentriesupdate.go - - tests/mockserver/internal/sdk/models/operations/accountingledgeraccountsadd.go - - tests/mockserver/internal/sdk/models/operations/accountingledgeraccountsall.go - - tests/mockserver/internal/sdk/models/operations/accountingledgeraccountsdelete.go - - tests/mockserver/internal/sdk/models/operations/accountingledgeraccountsone.go - - tests/mockserver/internal/sdk/models/operations/accountingledgeraccountsupdate.go - - tests/mockserver/internal/sdk/models/operations/accountinglocationsadd.go - - tests/mockserver/internal/sdk/models/operations/accountinglocationsall.go - - tests/mockserver/internal/sdk/models/operations/accountinglocationsdelete.go - - tests/mockserver/internal/sdk/models/operations/accountinglocationsone.go - - tests/mockserver/internal/sdk/models/operations/accountinglocationsupdate.go - - tests/mockserver/internal/sdk/models/operations/accountingpaymentsadd.go - - tests/mockserver/internal/sdk/models/operations/accountingpaymentsall.go - - tests/mockserver/internal/sdk/models/operations/accountingpaymentsdelete.go - - tests/mockserver/internal/sdk/models/operations/accountingpaymentsone.go - - tests/mockserver/internal/sdk/models/operations/accountingpaymentsupdate.go - - tests/mockserver/internal/sdk/models/operations/accountingprofitandlossone.go - - tests/mockserver/internal/sdk/models/operations/accountingpurchaseordersadd.go - - tests/mockserver/internal/sdk/models/operations/accountingpurchaseordersall.go - - tests/mockserver/internal/sdk/models/operations/accountingpurchaseordersdelete.go - - tests/mockserver/internal/sdk/models/operations/accountingpurchaseordersone.go - - tests/mockserver/internal/sdk/models/operations/accountingpurchaseordersupdate.go - - tests/mockserver/internal/sdk/models/operations/accountingsubsidiariesadd.go - - tests/mockserver/internal/sdk/models/operations/accountingsubsidiariesall.go - - tests/mockserver/internal/sdk/models/operations/accountingsubsidiariesdelete.go - - tests/mockserver/internal/sdk/models/operations/accountingsubsidiariesone.go - - tests/mockserver/internal/sdk/models/operations/accountingsubsidiariesupdate.go - - tests/mockserver/internal/sdk/models/operations/accountingsuppliersadd.go - - tests/mockserver/internal/sdk/models/operations/accountingsuppliersall.go - - tests/mockserver/internal/sdk/models/operations/accountingsuppliersdelete.go - - tests/mockserver/internal/sdk/models/operations/accountingsuppliersone.go - - tests/mockserver/internal/sdk/models/operations/accountingsuppliersupdate.go - - tests/mockserver/internal/sdk/models/operations/accountingtaxratesadd.go - - tests/mockserver/internal/sdk/models/operations/accountingtaxratesall.go - - tests/mockserver/internal/sdk/models/operations/accountingtaxratesdelete.go - - tests/mockserver/internal/sdk/models/operations/accountingtaxratesone.go - - tests/mockserver/internal/sdk/models/operations/accountingtaxratesupdate.go - - tests/mockserver/internal/sdk/models/operations/accountingtrackingcategoriesadd.go - - tests/mockserver/internal/sdk/models/operations/accountingtrackingcategoriesall.go - - tests/mockserver/internal/sdk/models/operations/accountingtrackingcategoriesdelete.go - - tests/mockserver/internal/sdk/models/operations/accountingtrackingcategoriesone.go - - tests/mockserver/internal/sdk/models/operations/accountingtrackingcategoriesupdate.go - - tests/mockserver/internal/sdk/models/operations/atsapplicantsadd.go - - tests/mockserver/internal/sdk/models/operations/atsapplicantsall.go - - tests/mockserver/internal/sdk/models/operations/atsapplicantsdelete.go - - tests/mockserver/internal/sdk/models/operations/atsapplicantsone.go - - tests/mockserver/internal/sdk/models/operations/atsapplicantsupdate.go - - tests/mockserver/internal/sdk/models/operations/atsapplicationsadd.go - - tests/mockserver/internal/sdk/models/operations/atsapplicationsall.go - - tests/mockserver/internal/sdk/models/operations/atsapplicationsdelete.go - - tests/mockserver/internal/sdk/models/operations/atsapplicationsone.go - - tests/mockserver/internal/sdk/models/operations/atsapplicationsupdate.go - - tests/mockserver/internal/sdk/models/operations/atsjobsall.go - - tests/mockserver/internal/sdk/models/operations/atsjobsone.go - - tests/mockserver/internal/sdk/models/operations/connectorapiresourcecoverageone.go - - tests/mockserver/internal/sdk/models/operations/connectorapiresourcesone.go - - tests/mockserver/internal/sdk/models/operations/connectorapisall.go - - tests/mockserver/internal/sdk/models/operations/connectorapisone.go - - tests/mockserver/internal/sdk/models/operations/connectorconnectordocsone.go - - tests/mockserver/internal/sdk/models/operations/connectorconnectorresourcesone.go - - tests/mockserver/internal/sdk/models/operations/connectorconnectorsall.go - - tests/mockserver/internal/sdk/models/operations/connectorconnectorsone.go - - tests/mockserver/internal/sdk/models/operations/crmactivitiesadd.go - - tests/mockserver/internal/sdk/models/operations/crmactivitiesall.go - - tests/mockserver/internal/sdk/models/operations/crmactivitiesdelete.go - - tests/mockserver/internal/sdk/models/operations/crmactivitiesone.go - - tests/mockserver/internal/sdk/models/operations/crmactivitiesupdate.go - - tests/mockserver/internal/sdk/models/operations/crmcompaniesadd.go - - tests/mockserver/internal/sdk/models/operations/crmcompaniesall.go - - tests/mockserver/internal/sdk/models/operations/crmcompaniesdelete.go - - tests/mockserver/internal/sdk/models/operations/crmcompaniesone.go - - tests/mockserver/internal/sdk/models/operations/crmcompaniesupdate.go - - tests/mockserver/internal/sdk/models/operations/crmcontactsadd.go - - tests/mockserver/internal/sdk/models/operations/crmcontactsall.go - - tests/mockserver/internal/sdk/models/operations/crmcontactsdelete.go - - tests/mockserver/internal/sdk/models/operations/crmcontactsone.go - - tests/mockserver/internal/sdk/models/operations/crmcontactsupdate.go - - tests/mockserver/internal/sdk/models/operations/crmcustomobjectsadd.go - - tests/mockserver/internal/sdk/models/operations/crmcustomobjectsall.go - - tests/mockserver/internal/sdk/models/operations/crmcustomobjectschemasadd.go - - tests/mockserver/internal/sdk/models/operations/crmcustomobjectschemasall.go - - tests/mockserver/internal/sdk/models/operations/crmcustomobjectschemasdelete.go - - tests/mockserver/internal/sdk/models/operations/crmcustomobjectschemasone.go - - tests/mockserver/internal/sdk/models/operations/crmcustomobjectschemasupdate.go - - tests/mockserver/internal/sdk/models/operations/crmcustomobjectsdelete.go - - tests/mockserver/internal/sdk/models/operations/crmcustomobjectsone.go - - tests/mockserver/internal/sdk/models/operations/crmcustomobjectsupdate.go - - tests/mockserver/internal/sdk/models/operations/crmleadsadd.go - - tests/mockserver/internal/sdk/models/operations/crmleadsall.go - - tests/mockserver/internal/sdk/models/operations/crmleadsdelete.go - - tests/mockserver/internal/sdk/models/operations/crmleadsone.go - - tests/mockserver/internal/sdk/models/operations/crmleadsupdate.go - - tests/mockserver/internal/sdk/models/operations/crmnotesadd.go - - tests/mockserver/internal/sdk/models/operations/crmnotesall.go - - tests/mockserver/internal/sdk/models/operations/crmnotesdelete.go - - tests/mockserver/internal/sdk/models/operations/crmnotesone.go - - tests/mockserver/internal/sdk/models/operations/crmnotesupdate.go - - tests/mockserver/internal/sdk/models/operations/crmopportunitiesadd.go - - tests/mockserver/internal/sdk/models/operations/crmopportunitiesall.go - - tests/mockserver/internal/sdk/models/operations/crmopportunitiesdelete.go - - tests/mockserver/internal/sdk/models/operations/crmopportunitiesone.go - - tests/mockserver/internal/sdk/models/operations/crmopportunitiesupdate.go - - tests/mockserver/internal/sdk/models/operations/crmpipelinesadd.go - - tests/mockserver/internal/sdk/models/operations/crmpipelinesall.go - - tests/mockserver/internal/sdk/models/operations/crmpipelinesdelete.go - - tests/mockserver/internal/sdk/models/operations/crmpipelinesone.go - - tests/mockserver/internal/sdk/models/operations/crmpipelinesupdate.go - - tests/mockserver/internal/sdk/models/operations/crmusersadd.go - - tests/mockserver/internal/sdk/models/operations/crmusersall.go - - tests/mockserver/internal/sdk/models/operations/crmusersdelete.go - - tests/mockserver/internal/sdk/models/operations/crmusersone.go - - tests/mockserver/internal/sdk/models/operations/crmusersupdate.go - - tests/mockserver/internal/sdk/models/operations/ecommercecustomersall.go - - tests/mockserver/internal/sdk/models/operations/ecommercecustomersone.go - - tests/mockserver/internal/sdk/models/operations/ecommerceordersall.go - - tests/mockserver/internal/sdk/models/operations/ecommerceordersone.go - - tests/mockserver/internal/sdk/models/operations/ecommerceproductsall.go - - tests/mockserver/internal/sdk/models/operations/ecommerceproductsone.go - - tests/mockserver/internal/sdk/models/operations/ecommercestoresone.go - - tests/mockserver/internal/sdk/models/operations/filestoragedrivegroupsadd.go - - tests/mockserver/internal/sdk/models/operations/filestoragedrivegroupsall.go - - tests/mockserver/internal/sdk/models/operations/filestoragedrivegroupsdelete.go - - tests/mockserver/internal/sdk/models/operations/filestoragedrivegroupsone.go - - tests/mockserver/internal/sdk/models/operations/filestoragedrivegroupsupdate.go - - tests/mockserver/internal/sdk/models/operations/filestoragedrivesadd.go - - tests/mockserver/internal/sdk/models/operations/filestoragedrivesall.go - - tests/mockserver/internal/sdk/models/operations/filestoragedrivesdelete.go - - tests/mockserver/internal/sdk/models/operations/filestoragedrivesone.go - - tests/mockserver/internal/sdk/models/operations/filestoragedrivesupdate.go - - tests/mockserver/internal/sdk/models/operations/filestoragefilesall.go - - tests/mockserver/internal/sdk/models/operations/filestoragefilesdelete.go - - tests/mockserver/internal/sdk/models/operations/filestoragefilesdownload.go - - tests/mockserver/internal/sdk/models/operations/filestoragefilesexport.go - - tests/mockserver/internal/sdk/models/operations/filestoragefilesone.go - - tests/mockserver/internal/sdk/models/operations/filestoragefilessearch.go - - tests/mockserver/internal/sdk/models/operations/filestoragefilesupdate.go - - tests/mockserver/internal/sdk/models/operations/filestoragefoldersadd.go - - tests/mockserver/internal/sdk/models/operations/filestoragefolderscopy.go - - tests/mockserver/internal/sdk/models/operations/filestoragefoldersdelete.go - - tests/mockserver/internal/sdk/models/operations/filestoragefoldersone.go - - tests/mockserver/internal/sdk/models/operations/filestoragefoldersupdate.go - - tests/mockserver/internal/sdk/models/operations/filestoragesharedlinksadd.go - - tests/mockserver/internal/sdk/models/operations/filestoragesharedlinksall.go - - tests/mockserver/internal/sdk/models/operations/filestoragesharedlinksdelete.go - - tests/mockserver/internal/sdk/models/operations/filestoragesharedlinksone.go - - tests/mockserver/internal/sdk/models/operations/filestoragesharedlinksupdate.go - - tests/mockserver/internal/sdk/models/operations/filestorageuploadsessionsadd.go - - tests/mockserver/internal/sdk/models/operations/filestorageuploadsessionsdelete.go - - tests/mockserver/internal/sdk/models/operations/filestorageuploadsessionsfinish.go - - tests/mockserver/internal/sdk/models/operations/filestorageuploadsessionsone.go - - tests/mockserver/internal/sdk/models/operations/filestorageuploadsessionsupload.go - - tests/mockserver/internal/sdk/models/operations/hriscompaniesadd.go - - tests/mockserver/internal/sdk/models/operations/hriscompaniesall.go - - tests/mockserver/internal/sdk/models/operations/hriscompaniesdelete.go - - tests/mockserver/internal/sdk/models/operations/hriscompaniesone.go - - tests/mockserver/internal/sdk/models/operations/hriscompaniesupdate.go - - tests/mockserver/internal/sdk/models/operations/hrisdepartmentsadd.go - - tests/mockserver/internal/sdk/models/operations/hrisdepartmentsall.go - - tests/mockserver/internal/sdk/models/operations/hrisdepartmentsdelete.go - - tests/mockserver/internal/sdk/models/operations/hrisdepartmentsone.go - - tests/mockserver/internal/sdk/models/operations/hrisdepartmentsupdate.go - - tests/mockserver/internal/sdk/models/operations/hrisemployeepayrollsall.go - - tests/mockserver/internal/sdk/models/operations/hrisemployeepayrollsone.go - - tests/mockserver/internal/sdk/models/operations/hrisemployeesadd.go - - tests/mockserver/internal/sdk/models/operations/hrisemployeesall.go - - tests/mockserver/internal/sdk/models/operations/hrisemployeeschedulesall.go - - tests/mockserver/internal/sdk/models/operations/hrisemployeesdelete.go - - tests/mockserver/internal/sdk/models/operations/hrisemployeesone.go - - tests/mockserver/internal/sdk/models/operations/hrisemployeesupdate.go - - tests/mockserver/internal/sdk/models/operations/hrispayrollsall.go - - tests/mockserver/internal/sdk/models/operations/hrispayrollsone.go - - tests/mockserver/internal/sdk/models/operations/hristimeoffrequestsadd.go - - tests/mockserver/internal/sdk/models/operations/hristimeoffrequestsall.go - - tests/mockserver/internal/sdk/models/operations/hristimeoffrequestsdelete.go - - tests/mockserver/internal/sdk/models/operations/hristimeoffrequestsone.go - - tests/mockserver/internal/sdk/models/operations/hristimeoffrequestsupdate.go - - tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionsall.go - - tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionsone.go - - tests/mockserver/internal/sdk/models/operations/issuetrackingcollectiontagsall.go - - tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketcommentsadd.go - - tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketcommentsall.go - - tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketcommentsdelete.go - - tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketcommentsone.go - - tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketcommentsupdate.go - - tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketsadd.go - - tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketsall.go - - tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketsdelete.go - - tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketsone.go - - tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketsupdate.go - - tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionusersall.go - - tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionusersone.go - - tests/mockserver/internal/sdk/models/operations/smsmessagesadd.go - - tests/mockserver/internal/sdk/models/operations/smsmessagesall.go - - tests/mockserver/internal/sdk/models/operations/smsmessagesdelete.go - - tests/mockserver/internal/sdk/models/operations/smsmessagesone.go - - tests/mockserver/internal/sdk/models/operations/smsmessagesupdate.go - - tests/mockserver/internal/sdk/models/operations/vaultconnectioncustommappingsall.go - - tests/mockserver/internal/sdk/models/operations/vaultconnectionsall.go - - tests/mockserver/internal/sdk/models/operations/vaultconnectionsdelete.go - - tests/mockserver/internal/sdk/models/operations/vaultconnectionsettingsall.go - - tests/mockserver/internal/sdk/models/operations/vaultconnectionsettingsupdate.go - - tests/mockserver/internal/sdk/models/operations/vaultconnectionsimport.go - - tests/mockserver/internal/sdk/models/operations/vaultconnectionsone.go - - tests/mockserver/internal/sdk/models/operations/vaultconnectionstoken.go - - tests/mockserver/internal/sdk/models/operations/vaultconnectionsupdate.go - - tests/mockserver/internal/sdk/models/operations/vaultconsumerrequestcountsall.go - - tests/mockserver/internal/sdk/models/operations/vaultconsumersadd.go - - tests/mockserver/internal/sdk/models/operations/vaultconsumersall.go - - tests/mockserver/internal/sdk/models/operations/vaultconsumersdelete.go - - tests/mockserver/internal/sdk/models/operations/vaultconsumersone.go - - tests/mockserver/internal/sdk/models/operations/vaultconsumersupdate.go - - tests/mockserver/internal/sdk/models/operations/vaultcreatecallbackstate.go - - tests/mockserver/internal/sdk/models/operations/vaultcustomfieldsall.go - - tests/mockserver/internal/sdk/models/operations/vaultcustommappingsall.go - - tests/mockserver/internal/sdk/models/operations/vaultlogsall.go - - tests/mockserver/internal/sdk/models/operations/vaultsessionscreate.go - - tests/mockserver/internal/sdk/models/operations/vaultvalidateconnectionstate.go - - tests/mockserver/internal/sdk/models/operations/webhookeventlogsall.go - - tests/mockserver/internal/sdk/models/operations/webhookwebhooksadd.go - - tests/mockserver/internal/sdk/models/operations/webhookwebhooksall.go - - tests/mockserver/internal/sdk/models/operations/webhookwebhooksdelete.go - - tests/mockserver/internal/sdk/models/operations/webhookwebhooksone.go - - tests/mockserver/internal/sdk/models/operations/webhookwebhooksupdate.go - - tests/mockserver/internal/sdk/models/sdkerrors/badrequestresponseerror.go - - tests/mockserver/internal/sdk/models/sdkerrors/notfoundresponseerror.go - - tests/mockserver/internal/sdk/models/sdkerrors/paymentrequiredresponseerror.go - - tests/mockserver/internal/sdk/models/sdkerrors/unauthorizedresponseerror.go - - tests/mockserver/internal/sdk/models/sdkerrors/unprocessableresponseerror.go - - tests/mockserver/internal/sdk/types/bigint.go - - tests/mockserver/internal/sdk/types/date.go - - tests/mockserver/internal/sdk/types/datetime.go - - tests/mockserver/internal/sdk/types/decimal.go - - tests/mockserver/internal/sdk/types/jsonl/jsonl.go - - tests/mockserver/internal/sdk/types/pointers.go - - tests/mockserver/internal/sdk/utils/json.go - - tests/mockserver/internal/sdk/utils/reflect.go - - tests/mockserver/internal/sdk/utils/sort.go - - tests/mockserver/internal/server/doc.go - - tests/mockserver/internal/server/generated_handlers.go - - tests/mockserver/internal/server/internal_handlers.go - - tests/mockserver/internal/server/server.go - - tests/mockserver/internal/server/server_option.go - - tests/mockserver/internal/server/templates/log/index.html.tmpl - - tests/mockserver/internal/server/templates/log/operation.html.tmpl - - tests/mockserver/internal/server/templates/log/style.css.tmpl - - tests/mockserver/internal/tracking/requesttracker.go - - tests/mockserver/main.go examples: accounting.taxRatesAll: "": @@ -4017,7 +3143,7 @@ examples: x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" x-apideck-service-id: "salesforce" requestBody: - application/json: {"bill_number": "10001", "supplier": {"id": "12345", "display_name": "Windsurf Shop", "address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}}, "company_id": "12345", "currency": "USD", "currency_rate": 0.69, "tax_inclusive": true, "bill_date": "2020-09-30", "due_date": "2020-10-30", "paid_date": "2020-10-30", "po_number": "90000117", "reference": "INV-2024-001", "line_items": [{"row_id": "12345", "code": "120-C", "line_number": 1, "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", "type": "expense_account", "tax_amount": 27500, "total_amount": 27500, "quantity": 1, "unit_price": 27500.5, "unit_of_measure": "pc.", "discount_percentage": 0.01, "discount_amount": 19.99, "location_id": "12345", "department_id": "12345", "item": {"id": "12344", "code": "120-C", "name": "Model Y"}, "tax_rate": {"id": "123456", "rate": 10}, "ledger_account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "tracking_categories": [{"id": "123456", "name": "New York"}], "row_version": "1-12345"}], "terms": "Net 30 days", "balance": 27500, "deposit": 0, "sub_total": 27500, "total_tax": 2500, "total": 27500, "tax_code": "1234", "notes": "Some notes about this bill.", "status": "draft", "ledger_account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "payment_method": "cash", "channel": "email", "language": "EN", "accounting_by_row": false, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD"}, "discount_percentage": 5.5, "source_document_url": "https://www.invoicesolution.com/bill/123456", "tracking_categories": [{"id": "123456", "name": "New York"}], "row_version": "1-12345", "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}], "accounting_period": "01-24"} + application/json: {"bill_number": "10001", "supplier": {"id": "12345", "display_name": "Windsurf Shop", "address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}}, "company_id": "12345", "currency": "USD", "currency_rate": 0.69, "tax_inclusive": true, "bill_date": "2020-09-30", "due_date": "2020-10-30", "paid_date": "2020-10-30", "po_number": "90000117", "reference": "INV-2024-001", "line_items": [{"row_id": "12345", "code": "120-C", "line_number": 1, "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", "type": "expense_account", "tax_amount": 27500, "total_amount": 27500, "quantity": 1, "unit_price": 27500.5, "unit_of_measure": "pc.", "discount_percentage": 0.01, "discount_amount": 19.99, "location_id": "12345", "department_id": "12345", "item": {"id": "12344", "code": "120-C", "name": "Model Y"}, "tax_rate": {"id": "123456", "rate": 10}, "ledger_account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "tracking_categories": [{"id": "123456", "name": "New York"}], "row_version": "1-12345"}], "terms": "Net 30 days", "balance": 27500, "deposit": 0, "sub_total": 27500, "total_tax": 2500, "total": 27500, "tax_code": "1234", "notes": "Some notes about this bill.", "status": "draft", "ledger_account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "payment_method": "cash", "channel": "email", "language": "EN", "accounting_by_row": false, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD", "country": "US"}, "discount_percentage": 5.5, "source_document_url": "https://www.invoicesolution.com/bill/123456", "tracking_categories": [{"id": "123456", "name": "New York"}], "row_version": "1-12345", "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}], "accounting_period": "01-24"} responses: "201": application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "bills", "operation": "add", "data": {"id": "12345"}} @@ -4073,7 +3199,7 @@ examples: x-apideck-service-id: "salesforce" responses: "200": - application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "bills", "operation": "one", "data": {"id": "12345", "downstream_id": "12345", "bill_number": "10001", "supplier": {"id": "12345", "display_id": "SUPP00101", "display_name": "Windsurf Shop", "company_name": "The boring company", "address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}}, "company_id": "12345", "currency": "USD", "currency_rate": 0.69, "tax_inclusive": true, "bill_date": "2020-09-30", "due_date": "2020-10-30", "paid_date": "2020-10-30", "po_number": "90000117", "reference": "INV-2024-001", "line_items": [{"id": "12345", "row_id": "12345", "code": "120-C", "line_number": 1, "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", "type": "expense_account", "tax_amount": 27500, "total_amount": 27500, "quantity": 1, "unit_price": 27500.5, "unit_of_measure": "pc.", "discount_percentage": 0.01, "discount_amount": 19.99, "location_id": "12345", "department_id": "12345", "item": {"id": "12344", "code": "120-C", "name": "Model Y"}, "tax_rate": {"id": "123456", "code": "N-T", "name": "GST on Purchases", "rate": 10}, "ledger_account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453"}, "tracking_categories": [{"id": "123456", "name": "New York"}], "row_version": "1-12345", "updated_by": "12345", "created_by": "12345", "created_at": "2020-09-30T07:43:32.000Z", "updated_at": "2020-09-30T07:43:32.000Z"}], "terms": "Net 30 days", "balance": 27500, "deposit": 0, "sub_total": 27500, "total_tax": 2500, "total": 27500, "tax_code": "1234", "notes": "Some notes about this bill.", "status": "draft", "ledger_account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453"}, "payment_method": "cash", "channel": "email", "language": "EN", "accounting_by_row": false, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD"}, "discount_percentage": 5.5, "source_document_url": "https://www.invoicesolution.com/bill/123456", "tracking_categories": [{"id": "123456", "name": "New York"}], "updated_by": "12345", "created_by": "12345", "updated_at": "2020-09-30T07:43:32.000Z", "created_at": "2020-09-30T07:43:32.000Z", "row_version": "1-12345", "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}], "accounting_period": "01-24"}} + application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "bills", "operation": "one", "data": {"id": "12345", "downstream_id": "12345", "bill_number": "10001", "supplier": {"id": "12345", "display_id": "SUPP00101", "display_name": "Windsurf Shop", "company_name": "The boring company", "address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}}, "company_id": "12345", "currency": "USD", "currency_rate": 0.69, "tax_inclusive": true, "bill_date": "2020-09-30", "due_date": "2020-10-30", "paid_date": "2020-10-30", "po_number": "90000117", "reference": "INV-2024-001", "line_items": [{"id": "12345", "row_id": "12345", "code": "120-C", "line_number": 1, "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", "type": "expense_account", "tax_amount": 27500, "total_amount": 27500, "quantity": 1, "unit_price": 27500.5, "unit_of_measure": "pc.", "discount_percentage": 0.01, "discount_amount": 19.99, "location_id": "12345", "department_id": "12345", "item": {"id": "12344", "code": "120-C", "name": "Model Y"}, "tax_rate": {"id": "123456", "code": "N-T", "name": "GST on Purchases", "rate": 10}, "ledger_account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453"}, "tracking_categories": [{"id": "123456", "name": "New York"}], "row_version": "1-12345", "updated_by": "12345", "created_by": "12345", "created_at": "2020-09-30T07:43:32.000Z", "updated_at": "2020-09-30T07:43:32.000Z"}], "terms": "Net 30 days", "balance": 27500, "deposit": 0, "sub_total": 27500, "total_tax": 2500, "total": 27500, "tax_code": "1234", "notes": "Some notes about this bill.", "status": "draft", "ledger_account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453"}, "payment_method": "cash", "channel": "email", "language": "EN", "accounting_by_row": false, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD", "country": "US"}, "discount_percentage": 5.5, "source_document_url": "https://www.invoicesolution.com/bill/123456", "tracking_categories": [{"id": "123456", "name": "New York"}], "updated_by": "12345", "created_by": "12345", "updated_at": "2020-09-30T07:43:32.000Z", "created_at": "2020-09-30T07:43:32.000Z", "row_version": "1-12345", "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}], "accounting_period": "01-24"}} "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": @@ -4125,7 +3251,7 @@ examples: x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" x-apideck-service-id: "salesforce" requestBody: - application/json: {"bill_number": "10001", "supplier": {"id": "12345", "display_name": "Windsurf Shop", "address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}}, "company_id": "12345", "currency": "USD", "currency_rate": 0.69, "tax_inclusive": true, "bill_date": "2020-09-30", "due_date": "2020-10-30", "paid_date": "2020-10-30", "po_number": "90000117", "reference": "INV-2024-001", "line_items": [{"row_id": "12345", "code": "120-C", "line_number": 1, "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", "type": "expense_account", "tax_amount": 27500, "total_amount": 27500, "quantity": 1, "unit_price": 27500.5, "unit_of_measure": "pc.", "discount_percentage": 0.01, "discount_amount": 19.99, "location_id": "12345", "department_id": "12345", "item": {"id": "12344", "code": "120-C", "name": "Model Y"}, "tax_rate": {"id": "123456", "rate": 10}, "ledger_account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "tracking_categories": [{"id": "123456", "name": "New York"}], "row_version": "1-12345"}], "terms": "Net 30 days", "balance": 27500, "deposit": 0, "sub_total": 27500, "total_tax": 2500, "total": 27500, "tax_code": "1234", "notes": "Some notes about this bill.", "status": "draft", "ledger_account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "payment_method": "cash", "channel": "email", "language": "EN", "accounting_by_row": false, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD"}, "discount_percentage": 5.5, "source_document_url": "https://www.invoicesolution.com/bill/123456", "tracking_categories": [{"id": "123456", "name": "New York"}], "row_version": "1-12345", "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}], "accounting_period": "01-24"} + application/json: {"bill_number": "10001", "supplier": {"id": "12345", "display_name": "Windsurf Shop", "address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}}, "company_id": "12345", "currency": "USD", "currency_rate": 0.69, "tax_inclusive": true, "bill_date": "2020-09-30", "due_date": "2020-10-30", "paid_date": "2020-10-30", "po_number": "90000117", "reference": "INV-2024-001", "line_items": [{"row_id": "12345", "code": "120-C", "line_number": 1, "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", "type": "expense_account", "tax_amount": 27500, "total_amount": 27500, "quantity": 1, "unit_price": 27500.5, "unit_of_measure": "pc.", "discount_percentage": 0.01, "discount_amount": 19.99, "location_id": "12345", "department_id": "12345", "item": {"id": "12344", "code": "120-C", "name": "Model Y"}, "tax_rate": {"id": "123456", "rate": 10}, "ledger_account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "tracking_categories": [{"id": "123456", "name": "New York"}], "row_version": "1-12345"}], "terms": "Net 30 days", "balance": 27500, "deposit": 0, "sub_total": 27500, "total_tax": 2500, "total": 27500, "tax_code": "1234", "notes": "Some notes about this bill.", "status": "draft", "ledger_account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "payment_method": "cash", "channel": "email", "language": "EN", "accounting_by_row": false, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD", "country": "US"}, "discount_percentage": 5.5, "source_document_url": "https://www.invoicesolution.com/bill/123456", "tracking_categories": [{"id": "123456", "name": "New York"}], "row_version": "1-12345", "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}], "accounting_period": "01-24"} responses: "200": application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "bills", "operation": "update", "data": {"id": "12345"}} @@ -4284,7 +3410,7 @@ examples: x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" x-apideck-service-id: "salesforce" requestBody: - application/json: {"type": "service", "number": "OIT00546", "customer": {"id": "12345", "display_name": "Windsurf Shop", "email": "boring@boring.com"}, "company_id": "12345", "invoice_date": "2020-09-30", "due_date": "2020-09-30", "terms": "Net 30 days", "po_number": "90000117", "reference": "INV-2024-001", "status": "draft", "invoice_sent": true, "currency": "USD", "currency_rate": 0.69, "tax_inclusive": true, "sub_total": 27500, "total_tax": 2500, "tax_code": "1234", "discount_percentage": 5.5, "discount_amount": 25, "total": 27500, "balance": 27500, "deposit": 0, "customer_memo": "Thank you for your business and have a great day!", "tracking_categories": [{"id": "123456", "name": "New York"}], "line_items": [{"id": "12345", "row_id": "12345", "code": "120-C", "line_number": 1, "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", "type": "sales_item", "tax_amount": 27500, "total_amount": 27500, "quantity": 1, "unit_price": 27500.5, "unit_of_measure": "pc.", "discount_percentage": 0.01, "discount_amount": 19.99, "location_id": "12345", "department_id": "12345", "item": {"id": "12344", "code": "120-C", "name": "Model Y"}, "tax_rate": {"id": "123456", "rate": 10}, "tracking_categories": [{"id": "123456", "name": "New York"}], "ledger_account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345"}], "billing_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}, "shipping_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}, "template_id": "123456", "source_document_url": "https://www.invoicesolution.com/invoice/123456", "payment_allocations": [{"id": "123456", "allocated_amount": 1000, "date": "2020-09-30T07:43:32.000Z"}], "payment_method": "cash", "channel": "email", "language": "EN", "accounting_by_row": false, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD"}, "ledger_account": null, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]} + application/json: {"type": "service", "number": "OIT00546", "customer": {"id": "12345", "display_name": "Windsurf Shop", "email": "boring@boring.com"}, "company_id": "12345", "invoice_date": "2020-09-30", "due_date": "2020-09-30", "terms": "Net 30 days", "po_number": "90000117", "reference": "INV-2024-001", "status": "draft", "invoice_sent": true, "currency": "USD", "currency_rate": 0.69, "tax_inclusive": true, "sub_total": 27500, "total_tax": 2500, "tax_code": "1234", "discount_percentage": 5.5, "discount_amount": 25, "total": 27500, "balance": 27500, "deposit": 0, "customer_memo": "Thank you for your business and have a great day!", "tracking_categories": [{"id": "123456", "name": "New York"}], "line_items": [{"id": "12345", "row_id": "12345", "code": "120-C", "line_number": 1, "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", "type": "sales_item", "tax_amount": 27500, "total_amount": 27500, "quantity": 1, "unit_price": 27500.5, "unit_of_measure": "pc.", "discount_percentage": 0.01, "discount_amount": 19.99, "location_id": "12345", "department_id": "12345", "item": {"id": "12344", "code": "120-C", "name": "Model Y"}, "tax_rate": {"id": "123456", "rate": 10}, "tracking_categories": [{"id": "123456", "name": "New York"}], "ledger_account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345"}], "billing_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}, "shipping_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}, "template_id": "123456", "source_document_url": "https://www.invoicesolution.com/invoice/123456", "payment_allocations": [{"id": "123456", "allocated_amount": 1000, "date": "2020-09-30T07:43:32.000Z"}], "payment_method": "cash", "channel": "email", "language": "EN", "accounting_by_row": false, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD", "country": "US"}, "ledger_account": null, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]} responses: "201": application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "invoices", "operation": "add", "data": {"id": "12345", "downstream_id": "12345"}} @@ -4340,7 +3466,7 @@ examples: x-apideck-service-id: "salesforce" responses: "200": - application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "invoices", "operation": "one", "data": {"id": "12345", "downstream_id": "12345", "type": "service", "number": "OIT00546", "customer": null, "company_id": "12345", "invoice_date": "2020-09-30", "due_date": "2020-09-30", "terms": "Net 30 days", "po_number": "90000117", "reference": "INV-2024-001", "status": "draft", "invoice_sent": true, "currency": "USD", "currency_rate": 0.69, "tax_inclusive": true, "sub_total": 27500, "total_tax": 2500, "tax_code": "1234", "discount_percentage": 5.5, "discount_amount": 25, "total": 27500, "balance": 27500, "deposit": 0, "customer_memo": "Thank you for your business and have a great day!", "tracking_categories": [{"id": "123456", "name": "New York"}], "line_items": [{"id": "12345", "row_id": "12345", "code": "120-C", "line_number": 1, "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", "type": "sales_item", "tax_amount": 27500, "total_amount": 27500, "quantity": 1, "unit_price": 27500.5, "unit_of_measure": "pc.", "discount_percentage": 0.01, "discount_amount": 19.99, "location_id": "12345", "department_id": "12345", "item": {"id": "12344", "code": "120-C", "name": "Model Y"}, "tax_rate": {"id": "123456", "code": "N-T", "name": "GST on Purchases", "rate": 10}, "tracking_categories": [{"id": "123456", "name": "New York"}], "ledger_account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453"}, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "updated_by": "12345", "created_by": "12345", "created_at": "2020-09-30T07:43:32.000Z", "updated_at": "2020-09-30T07:43:32.000Z"}], "billing_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}, "shipping_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}, "template_id": "123456", "source_document_url": "https://www.invoicesolution.com/invoice/123456", "payment_allocations": [{"id": "123456", "allocated_amount": 1000, "date": "2020-09-30T07:43:32.000Z"}], "payment_method": "cash", "channel": "email", "language": "EN", "accounting_by_row": false, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD"}, "ledger_account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453"}, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "updated_by": "12345", "created_by": "12345", "updated_at": "2020-09-30T07:43:32.000Z", "created_at": "2020-09-30T07:43:32.000Z", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]}} + application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "invoices", "operation": "one", "data": {"id": "12345", "downstream_id": "12345", "type": "service", "number": "OIT00546", "customer": null, "company_id": "12345", "invoice_date": "2020-09-30", "due_date": "2020-09-30", "terms": "Net 30 days", "po_number": "90000117", "reference": "INV-2024-001", "status": "draft", "invoice_sent": true, "currency": "USD", "currency_rate": 0.69, "tax_inclusive": true, "sub_total": 27500, "total_tax": 2500, "tax_code": "1234", "discount_percentage": 5.5, "discount_amount": 25, "total": 27500, "balance": 27500, "deposit": 0, "customer_memo": "Thank you for your business and have a great day!", "tracking_categories": [{"id": "123456", "name": "New York"}], "line_items": [{"id": "12345", "row_id": "12345", "code": "120-C", "line_number": 1, "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", "type": "sales_item", "tax_amount": 27500, "total_amount": 27500, "quantity": 1, "unit_price": 27500.5, "unit_of_measure": "pc.", "discount_percentage": 0.01, "discount_amount": 19.99, "location_id": "12345", "department_id": "12345", "item": {"id": "12344", "code": "120-C", "name": "Model Y"}, "tax_rate": {"id": "123456", "code": "N-T", "name": "GST on Purchases", "rate": 10}, "tracking_categories": [{"id": "123456", "name": "New York"}], "ledger_account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453"}, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "updated_by": "12345", "created_by": "12345", "created_at": "2020-09-30T07:43:32.000Z", "updated_at": "2020-09-30T07:43:32.000Z"}], "billing_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}, "shipping_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}, "template_id": "123456", "source_document_url": "https://www.invoicesolution.com/invoice/123456", "payment_allocations": [{"id": "123456", "allocated_amount": 1000, "date": "2020-09-30T07:43:32.000Z"}], "payment_method": "cash", "channel": "email", "language": "EN", "accounting_by_row": false, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD", "country": "US"}, "ledger_account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453"}, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "updated_by": "12345", "created_by": "12345", "updated_at": "2020-09-30T07:43:32.000Z", "created_at": "2020-09-30T07:43:32.000Z", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]}} "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": @@ -4392,7 +3518,7 @@ examples: x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" x-apideck-service-id: "salesforce" requestBody: - application/json: {"type": "service", "number": "OIT00546", "customer": {"id": "12345", "display_name": "Windsurf Shop", "email": "boring@boring.com"}, "company_id": "12345", "invoice_date": "2020-09-30", "due_date": "2020-09-30", "terms": "Net 30 days", "po_number": "90000117", "reference": "INV-2024-001", "status": "draft", "invoice_sent": true, "currency": "USD", "currency_rate": 0.69, "tax_inclusive": true, "sub_total": 27500, "total_tax": 2500, "tax_code": "1234", "discount_percentage": 5.5, "discount_amount": 25, "total": 27500, "balance": 27500, "deposit": 0, "customer_memo": "Thank you for your business and have a great day!", "tracking_categories": [{"id": "123456", "name": "New York"}], "line_items": [{"id": "12345", "row_id": "12345", "code": "120-C", "line_number": 1, "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", "type": "sales_item", "tax_amount": 27500, "total_amount": 27500, "quantity": 1, "unit_price": 27500.5, "unit_of_measure": "pc.", "discount_percentage": 0.01, "discount_amount": 19.99, "location_id": "12345", "department_id": "12345", "item": {"id": "12344", "code": "120-C", "name": "Model Y"}, "tax_rate": {"id": "123456", "rate": 10}, "tracking_categories": null, "ledger_account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345"}], "billing_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}, "shipping_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}, "template_id": "123456", "source_document_url": "https://www.invoicesolution.com/invoice/123456", "payment_allocations": [{"id": "123456", "allocated_amount": 1000, "date": "2020-09-30T07:43:32.000Z"}], "payment_method": "cash", "channel": "email", "language": "EN", "accounting_by_row": false, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD"}, "ledger_account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]} + application/json: {"type": "service", "number": "OIT00546", "customer": {"id": "12345", "display_name": "Windsurf Shop", "email": "boring@boring.com"}, "company_id": "12345", "invoice_date": "2020-09-30", "due_date": "2020-09-30", "terms": "Net 30 days", "po_number": "90000117", "reference": "INV-2024-001", "status": "draft", "invoice_sent": true, "currency": "USD", "currency_rate": 0.69, "tax_inclusive": true, "sub_total": 27500, "total_tax": 2500, "tax_code": "1234", "discount_percentage": 5.5, "discount_amount": 25, "total": 27500, "balance": 27500, "deposit": 0, "customer_memo": "Thank you for your business and have a great day!", "tracking_categories": [{"id": "123456", "name": "New York"}], "line_items": [{"id": "12345", "row_id": "12345", "code": "120-C", "line_number": 1, "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", "type": "sales_item", "tax_amount": 27500, "total_amount": 27500, "quantity": 1, "unit_price": 27500.5, "unit_of_measure": "pc.", "discount_percentage": 0.01, "discount_amount": 19.99, "location_id": "12345", "department_id": "12345", "item": {"id": "12344", "code": "120-C", "name": "Model Y"}, "tax_rate": {"id": "123456", "rate": 10}, "tracking_categories": null, "ledger_account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345"}], "billing_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}, "shipping_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}, "template_id": "123456", "source_document_url": "https://www.invoicesolution.com/invoice/123456", "payment_allocations": [{"id": "123456", "allocated_amount": 1000, "date": "2020-09-30T07:43:32.000Z"}], "payment_method": "cash", "channel": "email", "language": "EN", "accounting_by_row": false, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD", "country": "US"}, "ledger_account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]} responses: "200": application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "invoices", "operation": "update", "data": {"id": "12345", "downstream_id": "12345"}} @@ -4551,7 +3677,7 @@ examples: x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" x-apideck-service-id: "salesforce" requestBody: - application/json: {"display_id": "1-12345", "code": "453", "classification": "asset", "type": "bank", "sub_type": "CHECKING_ACCOUNT", "name": "Bank account", "fully_qualified_name": "Asset.Bank.Checking_Account", "description": "Main checking account", "opening_balance": 75000, "current_balance": 20000, "currency": "USD", "tax_type": "NONE", "tax_rate": {"id": "123456", "rate": 10}, "level": 1, "active": true, "status": "active", "header": true, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD"}, "parent_account": {"id": "12345", "name": "Bank Accounts", "display_id": "1-1100"}, "sub_account": false, "last_reconciliation_date": "2020-09-30", "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]} + application/json: {"display_id": "1-12345", "code": "453", "classification": "asset", "type": "bank", "sub_type": "CHECKING_ACCOUNT", "name": "Bank account", "fully_qualified_name": "Asset.Bank.Checking_Account", "description": "Main checking account", "opening_balance": 75000, "current_balance": 20000, "currency": "USD", "tax_type": "NONE", "tax_rate": {"id": "123456", "rate": 10}, "level": 1, "active": true, "status": "active", "header": true, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD", "country": "US"}, "parent_account": {"id": "12345", "name": "Bank Accounts", "display_id": "1-1100"}, "sub_account": false, "last_reconciliation_date": "2020-09-30", "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]} responses: "201": application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "ledger-accounts", "operation": "add", "data": {"id": "12345"}} @@ -4607,7 +3733,7 @@ examples: x-apideck-service-id: "salesforce" responses: "200": - application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "ledger-accounts", "operation": "one", "data": {"id": "12345", "display_id": "1-12345", "code": "453", "classification": "asset", "type": "bank", "sub_type": "CHECKING_ACCOUNT", "name": "Bank account", "fully_qualified_name": "Asset.Bank.Checking_Account", "description": "Main checking account", "opening_balance": 75000, "current_balance": 20000, "currency": "USD", "tax_type": "NONE", "tax_rate": {"id": "123456", "code": "N-T", "name": "GST on Purchases", "rate": 10}, "level": 1, "active": true, "status": "active", "header": true, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD"}, "categories": [{"id": "12345", "name": "Finance Charges Expense"}], "parent_account": {"id": "12345", "name": "Bank Accounts", "display_id": "1-1100"}, "sub_account": false, "sub_accounts": [{"id": "12345", "account_sub_name": "Petty Cash"}], "last_reconciliation_date": "2020-09-30", "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "updated_by": "12345", "created_by": "12345", "updated_at": "2020-09-30T07:43:32.000Z", "created_at": "2020-09-30T07:43:32.000Z", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]}} + application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "ledger-accounts", "operation": "one", "data": {"id": "12345", "display_id": "1-12345", "code": "453", "classification": "asset", "type": "bank", "sub_type": "CHECKING_ACCOUNT", "name": "Bank account", "fully_qualified_name": "Asset.Bank.Checking_Account", "description": "Main checking account", "opening_balance": 75000, "current_balance": 20000, "currency": "USD", "tax_type": "NONE", "tax_rate": {"id": "123456", "code": "N-T", "name": "GST on Purchases", "rate": 10}, "level": 1, "active": true, "status": "active", "header": true, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD", "country": "US"}, "categories": [{"id": "12345", "name": "Finance Charges Expense"}], "parent_account": {"id": "12345", "name": "Bank Accounts", "display_id": "1-1100"}, "sub_account": false, "sub_accounts": [{"id": "12345", "account_sub_name": "Petty Cash"}], "last_reconciliation_date": "2020-09-30", "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "updated_by": "12345", "created_by": "12345", "updated_at": "2020-09-30T07:43:32.000Z", "created_at": "2020-09-30T07:43:32.000Z", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]}} "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": @@ -4659,7 +3785,7 @@ examples: x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" x-apideck-service-id: "salesforce" requestBody: - application/json: {"display_id": "1-12345", "code": "453", "classification": "asset", "type": "bank", "sub_type": "CHECKING_ACCOUNT", "name": "Bank account", "fully_qualified_name": "Asset.Bank.Checking_Account", "description": "Main checking account", "opening_balance": 75000, "current_balance": 20000, "currency": "USD", "tax_type": "NONE", "tax_rate": {"id": "123456", "rate": 10}, "level": 1, "active": true, "status": "active", "header": true, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD"}, "parent_account": {"id": "12345", "name": "Bank Accounts", "display_id": "1-1100"}, "sub_account": false, "last_reconciliation_date": "2020-09-30", "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]} + application/json: {"display_id": "1-12345", "code": "453", "classification": "asset", "type": "bank", "sub_type": "CHECKING_ACCOUNT", "name": "Bank account", "fully_qualified_name": "Asset.Bank.Checking_Account", "description": "Main checking account", "opening_balance": 75000, "current_balance": 20000, "currency": "USD", "tax_type": "NONE", "tax_rate": {"id": "123456", "rate": 10}, "level": 1, "active": true, "status": "active", "header": true, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD", "country": "US"}, "parent_account": {"id": "12345", "name": "Bank Accounts", "display_id": "1-1100"}, "sub_account": false, "last_reconciliation_date": "2020-09-30", "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]} responses: "200": application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "ledger-accounts", "operation": "update", "data": {"id": "12345"}} @@ -5621,7 +4747,7 @@ examples: x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" x-apideck-service-id: "salesforce" requestBody: - application/json: {"display_id": "EMP00101", "display_name": "Windsurf Shop", "company_name": "SpaceX", "company_id": "12345", "supplier_category": "Insurance", "title": "CEO", "first_name": "Elon", "middle_name": "D.", "last_name": "Musk", "suffix": "Jr.", "individual": true, "addresses": [{"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}], "phone_numbers": [{"id": "12345", "country_code": "1", "area_code": "323", "number": "111-111-1111", "extension": "105", "type": "primary"}], "emails": [{"id": "123", "email": "elon@musk.com", "type": "primary"}], "websites": [{"id": "12345", "url": "http://example.com", "type": "primary"}], "bank_accounts": [{"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD"}], "notes": "Some notes about this supplier", "tax_rate": {"id": "123456", "rate": 10}, "tax_number": "US123945459", "currency": "USD", "account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "status": "active", "payment_method": "cash", "channel": "email", "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}], "subsidiary_id": "12345"} + application/json: {"display_id": "EMP00101", "display_name": "Windsurf Shop", "company_name": "SpaceX", "company_id": "12345", "supplier_category": "Insurance", "title": "CEO", "first_name": "Elon", "middle_name": "D.", "last_name": "Musk", "suffix": "Jr.", "individual": true, "addresses": [{"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}], "phone_numbers": [{"id": "12345", "country_code": "1", "area_code": "323", "number": "111-111-1111", "extension": "105", "type": "primary"}], "emails": [{"id": "123", "email": "elon@musk.com", "type": "primary"}], "websites": [{"id": "12345", "url": "http://example.com", "type": "primary"}], "bank_accounts": [{"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD"}], "notes": "Some notes about this supplier", "tax_rate": {"id": "123456", "rate": 10}, "tax_number": "US123945459", "currency": "USD", "account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "status": "active", "payment_method": "cash", "terms": "Net 30 days", "channel": "email", "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}], "subsidiary_id": "12345"} responses: "201": application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "payments", "operation": "add", "data": {"id": "12345"}} @@ -5677,7 +4803,7 @@ examples: x-apideck-service-id: "salesforce" responses: "200": - application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "suppliers", "operation": "one", "data": {"id": "12345", "downstream_id": "12345", "display_id": "EMP00101", "display_name": "Windsurf Shop", "company_name": "SpaceX", "company_id": "12345", "supplier_category": "Insurance", "title": "CEO", "first_name": "Elon", "middle_name": "D.", "last_name": "Musk", "suffix": "Jr.", "individual": true, "addresses": [{"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}], "phone_numbers": [{"id": "12345", "country_code": "1", "area_code": "323", "number": "111-111-1111", "extension": "105", "type": "primary"}], "emails": [{"id": "123", "email": "elon@musk.com", "type": "primary"}], "websites": [{"id": "12345", "url": "http://example.com", "type": "primary"}], "bank_accounts": [{"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD"}], "notes": "Some notes about this supplier", "tax_rate": {"id": "123456", "code": "N-T", "name": "GST on Purchases", "rate": 10}, "tax_number": "US123945459", "currency": "USD", "account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453"}, "status": "active", "payment_method": "cash", "channel": "email", "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "updated_by": "12345", "created_by": "12345", "updated_at": "2020-09-30T07:43:32.000Z", "created_at": "2020-09-30T07:43:32.000Z", "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}], "subsidiary_id": "12345"}} + application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "suppliers", "operation": "one", "data": {"id": "12345", "downstream_id": "12345", "display_id": "EMP00101", "display_name": "Windsurf Shop", "company_name": "SpaceX", "company_id": "12345", "supplier_category": "Insurance", "title": "CEO", "first_name": "Elon", "middle_name": "D.", "last_name": "Musk", "suffix": "Jr.", "individual": true, "addresses": [{"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}], "phone_numbers": [{"id": "12345", "country_code": "1", "area_code": "323", "number": "111-111-1111", "extension": "105", "type": "primary"}], "emails": [{"id": "123", "email": "elon@musk.com", "type": "primary"}], "websites": [{"id": "12345", "url": "http://example.com", "type": "primary"}], "bank_accounts": [{"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD"}], "notes": "Some notes about this supplier", "tax_rate": {"id": "123456", "code": "N-T", "name": "GST on Purchases", "rate": 10}, "tax_number": "US123945459", "currency": "USD", "account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453"}, "status": "active", "payment_method": "cash", "terms": "Net 30 days", "channel": "email", "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "updated_by": "12345", "created_by": "12345", "updated_at": "2020-09-30T07:43:32.000Z", "created_at": "2020-09-30T07:43:32.000Z", "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}], "subsidiary_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": @@ -5729,7 +4855,7 @@ examples: x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" x-apideck-service-id: "salesforce" requestBody: - application/json: {"display_id": "EMP00101", "display_name": "Windsurf Shop", "company_name": "SpaceX", "company_id": "12345", "supplier_category": "Insurance", "title": "CEO", "first_name": "Elon", "middle_name": "D.", "last_name": "Musk", "suffix": "Jr.", "individual": true, "addresses": [{"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}], "phone_numbers": [{"id": "12345", "country_code": "1", "area_code": "323", "number": "111-111-1111", "extension": "105", "type": "primary"}], "emails": [{"id": "123", "email": "elon@musk.com", "type": "primary"}], "websites": [{"id": "12345", "url": "http://example.com", "type": "primary"}], "bank_accounts": [{"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD"}], "notes": "Some notes about this supplier", "tax_rate": {"id": "123456", "rate": 10}, "tax_number": "US123945459", "currency": "USD", "account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "status": "active", "payment_method": "cash", "channel": "email", "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}], "subsidiary_id": "12345"} + application/json: {"display_id": "EMP00101", "display_name": "Windsurf Shop", "company_name": "SpaceX", "company_id": "12345", "supplier_category": "Insurance", "title": "CEO", "first_name": "Elon", "middle_name": "D.", "last_name": "Musk", "suffix": "Jr.", "individual": true, "addresses": [{"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}], "phone_numbers": [{"id": "12345", "country_code": "1", "area_code": "323", "number": "111-111-1111", "extension": "105", "type": "primary"}], "emails": [{"id": "123", "email": "elon@musk.com", "type": "primary"}], "websites": [{"id": "12345", "url": "http://example.com", "type": "primary"}], "bank_accounts": [{"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD"}], "notes": "Some notes about this supplier", "tax_rate": {"id": "123456", "rate": 10}, "tax_number": "US123945459", "currency": "USD", "account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "status": "active", "payment_method": "cash", "terms": "Net 30 days", "channel": "email", "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}], "subsidiary_id": "12345"} responses: "200": application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "suppliers", "operation": "update", "data": {"id": "12345"}} @@ -6573,7 +5699,7 @@ examples: x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" x-apideck-service-id: "salesforce" requestBody: - application/json: {"po_number": "90000117", "reference": "123456", "supplier": {"id": "12345", "display_name": "Windsurf Shop", "address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}}, "subsidiary_id": "12345", "company_id": "12345", "status": "open", "issued_date": "2020-09-30", "delivery_date": "2020-09-30", "expected_arrival_date": "2020-09-30", "currency": "USD", "currency_rate": 0.69, "sub_total": 27500, "total_tax": 2500, "total": 27500, "tax_inclusive": true, "line_items": [{"id": "12345", "row_id": "12345", "code": "120-C", "line_number": 1, "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", "type": "sales_item", "tax_amount": 27500, "total_amount": 27500, "quantity": 1, "unit_price": 27500.5, "unit_of_measure": "pc.", "discount_percentage": 0.01, "discount_amount": 19.99, "location_id": "12345", "department_id": "12345", "item": {"id": "12344", "code": "120-C", "name": "Model Y"}, "tax_rate": {"id": "123456", "rate": 10}, "tracking_categories": [{"id": "123456", "name": "New York"}], "ledger_account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345"}], "shipping_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}, "ledger_account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "template_id": "123456", "discount_percentage": 5.5, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD"}, "accounting_by_row": false, "due_date": "2020-10-30", "payment_method": "cash", "tax_code": "1234", "channel": "email", "memo": "Thank you for the partnership and have a great day!", "tracking_categories": [{"id": "123456", "name": "New York"}], "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]} + application/json: {"po_number": "90000117", "reference": "123456", "supplier": {"id": "12345", "display_name": "Windsurf Shop", "address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}}, "subsidiary_id": "12345", "company_id": "12345", "status": "open", "issued_date": "2020-09-30", "delivery_date": "2020-09-30", "expected_arrival_date": "2020-09-30", "currency": "USD", "currency_rate": 0.69, "sub_total": 27500, "total_tax": 2500, "total": 27500, "tax_inclusive": true, "line_items": [{"id": "12345", "row_id": "12345", "code": "120-C", "line_number": 1, "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", "type": "sales_item", "tax_amount": 27500, "total_amount": 27500, "quantity": 1, "unit_price": 27500.5, "unit_of_measure": "pc.", "discount_percentage": 0.01, "discount_amount": 19.99, "location_id": "12345", "department_id": "12345", "item": {"id": "12344", "code": "120-C", "name": "Model Y"}, "tax_rate": {"id": "123456", "rate": 10}, "tracking_categories": [{"id": "123456", "name": "New York"}], "ledger_account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345"}], "shipping_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}, "ledger_account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "template_id": "123456", "discount_percentage": 5.5, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD", "country": "US"}, "accounting_by_row": false, "due_date": "2020-10-30", "payment_method": "cash", "tax_code": "1234", "channel": "email", "memo": "Thank you for the partnership and have a great day!", "tracking_categories": [{"id": "123456", "name": "New York"}], "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]} responses: "201": application/json: {"status_code": 200, "status": "OK", "service": "quickbooks", "resource": "PurchaseOrders", "operation": "add", "data": {"id": "12345"}} @@ -6627,7 +5753,7 @@ examples: x-apideck-service-id: "salesforce" responses: "200": - application/json: {"status_code": 200, "status": "OK", "service": "quickbooks", "resource": "PurchaseOrders", "operation": "one", "data": {"id": "12345", "downstream_id": "12345", "po_number": "90000117", "reference": "123456", "supplier": {"id": "12345", "display_id": "SUPP00101", "display_name": "Windsurf Shop", "company_name": "The boring company", "address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}}, "subsidiary_id": "12345", "company_id": "12345", "status": "open", "issued_date": "2020-09-30", "delivery_date": "2020-09-30", "expected_arrival_date": "2020-09-30", "currency": "USD", "currency_rate": 0.69, "sub_total": 27500, "total_tax": 2500, "total": 27500, "tax_inclusive": true, "line_items": [{"id": "12345", "row_id": "12345", "code": "120-C", "line_number": 1, "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", "type": "sales_item", "tax_amount": 27500, "total_amount": 27500, "quantity": 1, "unit_price": 27500.5, "unit_of_measure": "pc.", "discount_percentage": 0.01, "discount_amount": 19.99, "location_id": "12345", "department_id": "12345", "item": {"id": "12344", "code": "120-C", "name": "Model Y"}, "tax_rate": {"id": "123456", "code": "N-T", "name": "GST on Purchases", "rate": 10}, "tracking_categories": null, "ledger_account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453"}, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "updated_by": "12345", "created_by": "12345", "created_at": "2020-09-30T07:43:32.000Z", "updated_at": "2020-09-30T07:43:32.000Z"}], "shipping_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}, "ledger_account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453"}, "template_id": "123456", "discount_percentage": 5.5, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD"}, "accounting_by_row": false, "due_date": "2020-10-30", "payment_method": "cash", "tax_code": "1234", "channel": "email", "memo": "Thank you for the partnership and have a great day!", "tracking_categories": [{"id": "123456", "name": "New York"}], "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "updated_by": "12345", "created_by": "12345", "updated_at": "2020-09-30T07:43:32.000Z", "created_at": "2020-09-30T07:43:32.000Z", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]}} + application/json: {"status_code": 200, "status": "OK", "service": "quickbooks", "resource": "PurchaseOrders", "operation": "one", "data": {"id": "12345", "downstream_id": "12345", "po_number": "90000117", "reference": "123456", "supplier": {"id": "12345", "display_id": "SUPP00101", "display_name": "Windsurf Shop", "company_name": "The boring company", "address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}}, "subsidiary_id": "12345", "company_id": "12345", "status": "open", "issued_date": "2020-09-30", "delivery_date": "2020-09-30", "expected_arrival_date": "2020-09-30", "currency": "USD", "currency_rate": 0.69, "sub_total": 27500, "total_tax": 2500, "total": 27500, "tax_inclusive": true, "line_items": [{"id": "12345", "row_id": "12345", "code": "120-C", "line_number": 1, "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", "type": "sales_item", "tax_amount": 27500, "total_amount": 27500, "quantity": 1, "unit_price": 27500.5, "unit_of_measure": "pc.", "discount_percentage": 0.01, "discount_amount": 19.99, "location_id": "12345", "department_id": "12345", "item": {"id": "12344", "code": "120-C", "name": "Model Y"}, "tax_rate": {"id": "123456", "code": "N-T", "name": "GST on Purchases", "rate": 10}, "tracking_categories": null, "ledger_account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453"}, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "updated_by": "12345", "created_by": "12345", "created_at": "2020-09-30T07:43:32.000Z", "updated_at": "2020-09-30T07:43:32.000Z"}], "shipping_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}, "ledger_account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453"}, "template_id": "123456", "discount_percentage": 5.5, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD", "country": "US"}, "accounting_by_row": false, "due_date": "2020-10-30", "payment_method": "cash", "tax_code": "1234", "channel": "email", "memo": "Thank you for the partnership and have a great day!", "tracking_categories": [{"id": "123456", "name": "New York"}], "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "updated_by": "12345", "created_by": "12345", "updated_at": "2020-09-30T07:43:32.000Z", "created_at": "2020-09-30T07:43:32.000Z", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]}} "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": @@ -6679,7 +5805,7 @@ examples: x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" x-apideck-service-id: "salesforce" requestBody: - application/json: {"po_number": "90000117", "reference": "123456", "supplier": {"id": "12345", "display_name": "Windsurf Shop", "address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}}, "subsidiary_id": "12345", "company_id": "12345", "status": "open", "issued_date": "2020-09-30", "delivery_date": "2020-09-30", "expected_arrival_date": "2020-09-30", "currency": "USD", "currency_rate": 0.69, "sub_total": 27500, "total_tax": 2500, "total": 27500, "tax_inclusive": true, "line_items": [{"id": "12345", "row_id": "12345", "code": "120-C", "line_number": 1, "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", "type": "sales_item", "tax_amount": 27500, "total_amount": 27500, "quantity": 1, "unit_price": 27500.5, "unit_of_measure": "pc.", "discount_percentage": 0.01, "discount_amount": 19.99, "location_id": "12345", "department_id": "12345", "item": {"id": "12344", "code": "120-C", "name": "Model Y"}, "tax_rate": {"id": "123456", "rate": 10}, "tracking_categories": [{"id": "123456", "name": "New York"}], "ledger_account": null, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345"}], "shipping_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}, "ledger_account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "template_id": "123456", "discount_percentage": 5.5, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD"}, "accounting_by_row": false, "due_date": "2020-10-30", "payment_method": "cash", "tax_code": "1234", "channel": "email", "memo": "Thank you for the partnership and have a great day!", "tracking_categories": [{"id": "123456", "name": "New York"}], "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]} + application/json: {"po_number": "90000117", "reference": "123456", "supplier": {"id": "12345", "display_name": "Windsurf Shop", "address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}}, "subsidiary_id": "12345", "company_id": "12345", "status": "open", "issued_date": "2020-09-30", "delivery_date": "2020-09-30", "expected_arrival_date": "2020-09-30", "currency": "USD", "currency_rate": 0.69, "sub_total": 27500, "total_tax": 2500, "total": 27500, "tax_inclusive": true, "line_items": [{"id": "12345", "row_id": "12345", "code": "120-C", "line_number": 1, "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", "type": "sales_item", "tax_amount": 27500, "total_amount": 27500, "quantity": 1, "unit_price": 27500.5, "unit_of_measure": "pc.", "discount_percentage": 0.01, "discount_amount": 19.99, "location_id": "12345", "department_id": "12345", "item": {"id": "12344", "code": "120-C", "name": "Model Y"}, "tax_rate": {"id": "123456", "rate": 10}, "tracking_categories": [{"id": "123456", "name": "New York"}], "ledger_account": null, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345"}], "shipping_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}, "ledger_account": {"id": "123456", "nominal_code": "N091", "code": "453"}, "template_id": "123456", "discount_percentage": 5.5, "bank_account": {"bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", "account_type": "credit_card", "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", "bsb_number": "062-001", "branch_identifier": "001", "bank_code": "BNH", "currency": "USD", "country": "US"}, "accounting_by_row": false, "due_date": "2020-10-30", "payment_method": "cash", "tax_code": "1234", "channel": "email", "memo": "Thank you for the partnership and have a great day!", "tracking_categories": [{"id": "123456", "name": "New York"}], "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]} responses: "200": application/json: {"status_code": 200, "status": "OK", "service": "quickbooks", "resource": "PurchaseOrders", "operation": "update", "data": {"id": "12345"}} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 10c554db..b82643ac 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -24,7 +24,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false python: - version: 0.19.0 + version: 0.20.0 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index a7a6554a..8ae9b02b 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.570.1 +speakeasyVersion: 1.580.0 sources: Apideck: sourceNamespace: apideck - sourceRevisionDigest: sha256:92f29919dab3af53e6278cecca2b95c38d5977dcc46fb4d9086360225ea2fd48 - sourceBlobDigest: sha256:312c9a0c323d213f0d91e2124e1feb346c5657e76b815a7a9b1bbcf6b5beb357 + sourceRevisionDigest: sha256:58d0abd0a05800047f98fd60dcebd853df732791a91a346c8515157f32999372 + sourceBlobDigest: sha256:82f9887e82aefa1d47227f638634d6085196d40364023afefff309946a16abb7 tags: - latest - - speakeasy-sdk-regen-1750931281 - - 10.18.0 + - speakeasy-sdk-regen-1751018986 + - 10.18.1 targets: apideck: source: Apideck sourceNamespace: apideck - sourceRevisionDigest: sha256:92f29919dab3af53e6278cecca2b95c38d5977dcc46fb4d9086360225ea2fd48 - sourceBlobDigest: sha256:312c9a0c323d213f0d91e2124e1feb346c5657e76b815a7a9b1bbcf6b5beb357 + sourceRevisionDigest: sha256:58d0abd0a05800047f98fd60dcebd853df732791a91a346c8515157f32999372 + sourceBlobDigest: sha256:82f9887e82aefa1d47227f638634d6085196d40364023afefff309946a16abb7 codeSamplesNamespace: apideck-python-code-samples - codeSamplesRevisionDigest: sha256:9f78fe93304d35cc64773e1adb027e0a6bb591ee982759f7b19b4deac7e0b490 + codeSamplesRevisionDigest: sha256:5b5baea355358a6fad5bccbc190d0377cd5a65aa1c91ba90d0ec104a40552c70 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 2d4efacd..3bbadde7 100644 --- a/README.md +++ b/README.md @@ -933,31 +933,20 @@ with Apideck( ## Error Handling -Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception. +[`ApideckError`](./src/apideck_unify/models/apideckerror.py) is the base class for all HTTP error responses. It has the following properties: -By default, an API error will raise a models.APIError exception, which has the following properties: - -| Property | Type | Description | -|-----------------|------------------|-----------------------| -| `.status_code` | *int* | The HTTP status code | -| `.message` | *str* | The error message | -| `.raw_response` | *httpx.Response* | The raw HTTP response | -| `.body` | *str* | The response content | - -When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `list_async` method may raise the following exceptions: - -| Error Type | Status Code | Content Type | -| ------------------------------ | ----------- | ---------------- | -| models.BadRequestResponse | 400 | application/json | -| models.UnauthorizedResponse | 401 | application/json | -| models.PaymentRequiredResponse | 402 | application/json | -| models.NotFoundResponse | 404 | application/json | -| models.UnprocessableResponse | 422 | application/json | -| models.APIError | 4XX, 5XX | \*/\* | +| Property | Type | Description | +| ------------------ | ---------------- | --------------------------------------------------------------------------------------- | +| `err.message` | `str` | Error message | +| `err.status_code` | `int` | HTTP response status code eg `404` | +| `err.headers` | `httpx.Headers` | HTTP response headers | +| `err.body` | `str` | HTTP body. Can be empty string if no body is returned. | +| `err.raw_response` | `httpx.Response` | Raw HTTP response | +| `err.data` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). | ### Example - ```python +import apideck_unify from apideck_unify import Apideck, models import os @@ -985,25 +974,49 @@ with Apideck( res = res.next() - except models.BadRequestResponse as e: - # handle e.data: models.BadRequestResponseData - raise(e) - except models.UnauthorizedResponse as e: - # handle e.data: models.UnauthorizedResponseData - raise(e) - except models.PaymentRequiredResponse as e: - # handle e.data: models.PaymentRequiredResponseData - raise(e) - except models.NotFoundResponse as e: - # handle e.data: models.NotFoundResponseData - raise(e) - except models.UnprocessableResponse as e: - # handle e.data: models.UnprocessableResponseData - raise(e) - except models.APIError as e: - # handle exception - raise(e) + + except models.ApideckError as e: + # The base class for HTTP error responses + print(e.message) + print(e.status_code) + print(e.body) + print(e.headers) + print(e.raw_response) + + # Depending on the method different errors may be thrown + if isinstance(e, models.BadRequestResponse): + print(e.data.status_code) # Optional[float] + print(e.data.error) # Optional[str] + print(e.data.type_name) # Optional[str] + print(e.data.message) # Optional[str] + print(e.data.detail) # Optional[apideck_unify.BadRequestResponseDetail] ``` + +### Error Classes +**Primary errors:** +* [`ApideckError`](./src/apideck_unify/models/apideckerror.py): The base class for HTTP error responses. + * [`UnauthorizedResponse`](./src/apideck_unify/models/unauthorizedresponse.py): Unauthorized. Status code `401`. + * [`PaymentRequiredResponse`](./src/apideck_unify/models/paymentrequiredresponse.py): Payment Required. Status code `402`. + * [`NotFoundResponse`](./src/apideck_unify/models/notfoundresponse.py): The specified resource was not found. Status code `404`. * + * [`BadRequestResponse`](./src/apideck_unify/models/badrequestresponse.py): Bad Request. Status code `400`. * + * [`UnprocessableResponse`](./src/apideck_unify/models/unprocessableresponse.py): Unprocessable. Status code `422`. * + +
Less common errors (5) + +
+ +**Network errors:** +* [`httpx.RequestError`](https://www.python-httpx.org/exceptions/#httpx.RequestError): Base class for request errors. + * [`httpx.ConnectError`](https://www.python-httpx.org/exceptions/#httpx.ConnectError): HTTP client was unable to make a request to a server. + * [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out. + + +**Inherit from [`ApideckError`](./src/apideck_unify/models/apideckerror.py)**: +* [`ResponseValidationError`](./src/apideck_unify/models/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute. + +
+ +\* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable. diff --git a/RELEASES.md b/RELEASES.md index dfd9c99a..d4f22b4c 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -328,4 +328,14 @@ Based on: ### Generated - [python v0.19.0] . ### Releases -- [PyPI v0.19.0] https://pypi.org/project/apideck-unify/0.19.0 - . \ No newline at end of file +- [PyPI v0.19.0] https://pypi.org/project/apideck-unify/0.19.0 - . + +## 2025-07-09 00:19:52 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.580.0 (2.654.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.20.0] . +### Releases +- [PyPI v0.20.0] https://pypi.org/project/apideck-unify/0.20.0 - . \ No newline at end of file diff --git a/docs/models/bankaccount.md b/docs/models/bankaccount.md index 3d4f9ff8..3874c93f 100644 --- a/docs/models/bankaccount.md +++ b/docs/models/bankaccount.md @@ -15,4 +15,5 @@ | `bsb_number` | *OptionalNullable[str]* | :heavy_minus_sign: | A BSB is a 6 digit numeric code used for identifying the branch of an Australian or New Zealand bank or financial institution. | 062-001 | | `branch_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | A branch identifier is a unique identifier for a branch of a bank or financial institution. | 001 | | `bank_code` | *OptionalNullable[str]* | :heavy_minus_sign: | A bank code is a code assigned by a central bank, a bank supervisory body or a Bankers Association in a country to all its licensed member banks or financial institutions. | BNH | -| `currency` | [OptionalNullable[models.Currency]](../models/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 | \ No newline at end of file +| `currency` | [OptionalNullable[models.Currency]](../models/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 | +| `country` | *OptionalNullable[str]* | :heavy_minus_sign: | Country code according to ISO 3166-1 alpha-2. | US | \ No newline at end of file diff --git a/docs/models/bankaccount1.md b/docs/models/bankaccount1.md new file mode 100644 index 00000000..26b2777e --- /dev/null +++ b/docs/models/bankaccount1.md @@ -0,0 +1,19 @@ +# BankAccount1 + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `bank_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the bank | Monzo | +| `account_number` | *OptionalNullable[str]* | :heavy_minus_sign: | A bank account number is a number that is tied to your bank account. If you have several bank accounts, such as personal, joint, business (and so on), each account will have a different account number. | 123465 | +| `account_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name which you used in opening your bank account. | SPACEX LLC | +| `account_type` | [OptionalNullable[models.BankAccount1AccountType]](../models/bankaccount1accounttype.md) | :heavy_minus_sign: | The type of bank account. | credit_card | +| `iban` | *OptionalNullable[str]* | :heavy_minus_sign: | The International Bank Account Number (IBAN). | CH2989144532982975332 | +| `bic` | *OptionalNullable[str]* | :heavy_minus_sign: | The Bank Identifier Code (BIC). | AUDSCHGGXXX | +| `routing_number` | *OptionalNullable[str]* | :heavy_minus_sign: | A routing number is a nine-digit code used to identify a financial institution in the United States. | 012345678 | +| `bsb_number` | *OptionalNullable[str]* | :heavy_minus_sign: | A BSB is a 6 digit numeric code used for identifying the branch of an Australian or New Zealand bank or financial institution. | 062-001 | +| `branch_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | A branch identifier is a unique identifier for a branch of a bank or financial institution. | 001 | +| `bank_code` | *OptionalNullable[str]* | :heavy_minus_sign: | A bank code is a code assigned by a central bank, a bank supervisory body or a Bankers Association in a country to all its licensed member banks or financial institutions. | BNH | +| `currency` | [OptionalNullable[models.Currency]](../models/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 | +| `country` | *OptionalNullable[str]* | :heavy_minus_sign: | Country code according to ISO 3166-1 alpha-2. | US | \ No newline at end of file diff --git a/docs/models/bankaccount1accounttype.md b/docs/models/bankaccount1accounttype.md new file mode 100644 index 00000000..1675bb51 --- /dev/null +++ b/docs/models/bankaccount1accounttype.md @@ -0,0 +1,12 @@ +# BankAccount1AccountType + +The type of bank account. + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `BANK_ACCOUNT` | bank_account | +| `CREDIT_CARD` | credit_card | +| `OTHER` | other | \ No newline at end of file diff --git a/docs/models/company.md b/docs/models/company1.md similarity index 99% rename from docs/models/company.md rename to docs/models/company1.md index 88b34cfb..514cc9db 100644 --- a/docs/models/company.md +++ b/docs/models/company1.md @@ -1,4 +1,4 @@ -# Company +# Company1 ## Fields @@ -27,7 +27,7 @@ | `first_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The first name of the person. | Elon | | `last_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The last name of the person. | Musk | | `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Parent ID | 22345 | -| `bank_accounts` | List[[models.BankAccount](../models/bankaccount.md)] | :heavy_minus_sign: | N/A | | +| `bank_accounts` | List[[models.BankAccount1](../models/bankaccount1.md)] | :heavy_minus_sign: | N/A | | | `websites` | List[[models.Website](../models/website.md)] | :heavy_minus_sign: | N/A | | | `addresses` | List[[models.Address](../models/address.md)] | :heavy_minus_sign: | N/A | | | `social_links` | List[[models.SocialLink](../models/sociallink.md)] | :heavy_minus_sign: | N/A | | diff --git a/docs/models/companyinput.md b/docs/models/company1input.md similarity index 99% rename from docs/models/companyinput.md rename to docs/models/company1input.md index 6e34d721..ed0b1de5 100644 --- a/docs/models/companyinput.md +++ b/docs/models/company1input.md @@ -1,4 +1,4 @@ -# CompanyInput +# Company1Input ## Fields @@ -24,7 +24,7 @@ | `acn` | *OptionalNullable[str]* | :heavy_minus_sign: | The Australian Company Number (ACN) is a nine digit number with the last digit being a check digit calculated using a modified modulus 10 calculation. ASIC has adopted a convention of always printing and displaying the ACN in the format XXX XXX XXX; three blocks of three characters, each block separated by a blank. | XXX XXX XXX | | `first_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The first name of the person. | Elon | | `last_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The last name of the person. | Musk | -| `bank_accounts` | List[[models.BankAccount](../models/bankaccount.md)] | :heavy_minus_sign: | N/A | | +| `bank_accounts` | List[[models.BankAccount1](../models/bankaccount1.md)] | :heavy_minus_sign: | N/A | | | `websites` | List[[models.Website](../models/website.md)] | :heavy_minus_sign: | N/A | | | `addresses` | List[[models.Address](../models/address.md)] | :heavy_minus_sign: | N/A | | | `social_links` | List[[models.SocialLink](../models/sociallink.md)] | :heavy_minus_sign: | N/A | | diff --git a/docs/models/companyinfo.md b/docs/models/companyinfo.md index d21d28b6..fdaf7b5b 100644 --- a/docs/models/companyinfo.md +++ b/docs/models/companyinfo.md @@ -22,6 +22,7 @@ | `phone_numbers` | List[[models.PhoneNumber](../models/phonenumber.md)] | :heavy_minus_sign: | N/A | | | `emails` | List[[models.Email](../models/email.md)] | :heavy_minus_sign: | N/A | | | `custom_mappings` | Dict[str, *Any*] | :heavy_minus_sign: | When custom mappings are configured on the resource, the result is included here. | | +| `tracking_categories_enabled` | *Optional[bool]* | :heavy_minus_sign: | Whether tracking categories are enabled for the company on transactions | | | `row_version` | *OptionalNullable[str]* | :heavy_minus_sign: | A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. | 1-12345 | | `updated_by` | *OptionalNullable[str]* | :heavy_minus_sign: | The user who last updated the object. | 12345 | | `created_by` | *OptionalNullable[str]* | :heavy_minus_sign: | The user who created the object. | 12345 | diff --git a/docs/models/crmcompaniesaddrequest.md b/docs/models/crmcompaniesaddrequest.md index 35539620..c3d7e012 100644 --- a/docs/models/crmcompaniesaddrequest.md +++ b/docs/models/crmcompaniesaddrequest.md @@ -9,4 +9,4 @@ | `consumer_id` | *Optional[str]* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | | `app_id` | *Optional[str]* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | | `service_id` | *Optional[str]* | :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 | -| `company` | [models.CompanyInput](../models/companyinput.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| `company1` | [models.Company1Input](../models/company1input.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/crmcompaniesupdaterequest.md b/docs/models/crmcompaniesupdaterequest.md index 1fc2ac49..b982566c 100644 --- a/docs/models/crmcompaniesupdaterequest.md +++ b/docs/models/crmcompaniesupdaterequest.md @@ -10,4 +10,4 @@ | `consumer_id` | *Optional[str]* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | | `app_id` | *Optional[str]* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | | `service_id` | *Optional[str]* | :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 | -| `company` | [models.CompanyInput](../models/companyinput.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| `company1` | [models.Company1Input](../models/company1input.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/getcompaniesresponse.md b/docs/models/getcompaniesresponse.md index 10ae5f98..79492532 100644 --- a/docs/models/getcompaniesresponse.md +++ b/docs/models/getcompaniesresponse.md @@ -12,7 +12,7 @@ Companies | `service` | *str* | :heavy_check_mark: | Apideck ID of service provider | zoho-crm | | `resource` | *str* | :heavy_check_mark: | Unified API resource name | companies | | `operation` | *str* | :heavy_check_mark: | Operation performed | all | -| `data` | List[[models.Company](../models/company.md)] | :heavy_check_mark: | N/A | | +| `data` | List[[models.Company1](../models/company1.md)] | :heavy_check_mark: | N/A | | | `meta` | [Optional[models.Meta]](../models/meta.md) | :heavy_minus_sign: | Response metadata | | | `links` | [Optional[models.Links]](../models/links.md) | :heavy_minus_sign: | Links to navigate to previous or next pages through the API | | | `raw` | Dict[str, *Any*] | :heavy_minus_sign: | Raw response from the integration when raw=true query param is provided | | \ No newline at end of file diff --git a/docs/models/getcompanyresponse.md b/docs/models/getcompanyresponse.md index b495b524..e46bb6ff 100644 --- a/docs/models/getcompanyresponse.md +++ b/docs/models/getcompanyresponse.md @@ -12,5 +12,5 @@ Company | `service` | *str* | :heavy_check_mark: | Apideck ID of service provider | zoho-crm | | `resource` | *str* | :heavy_check_mark: | Unified API resource name | companies | | `operation` | *str* | :heavy_check_mark: | Operation performed | one | -| `data` | [models.Company](../models/company.md) | :heavy_check_mark: | N/A | | +| `data` | [models.Company1](../models/company1.md) | :heavy_check_mark: | N/A | | | `raw` | Dict[str, *Any*] | :heavy_minus_sign: | Raw response from the integration when raw=true query param is provided | | \ No newline at end of file diff --git a/docs/models/supplier.md b/docs/models/supplier.md index 25dc5e46..ccc12531 100644 --- a/docs/models/supplier.md +++ b/docs/models/supplier.md @@ -30,6 +30,7 @@ | `account` | [OptionalNullable[models.LinkedLedgerAccount]](../models/linkedledgeraccount.md) | :heavy_minus_sign: | N/A | | | `status` | [OptionalNullable[models.SupplierStatus]](../models/supplierstatus.md) | :heavy_minus_sign: | Supplier status | active | | `payment_method` | *OptionalNullable[str]* | :heavy_minus_sign: | Payment method used for the transaction, such as cash, credit card, bank transfer, or check | cash | +| `terms` | *OptionalNullable[str]* | :heavy_minus_sign: | Terms of payment. | Net 30 days | | `channel` | *OptionalNullable[str]* | :heavy_minus_sign: | The channel through which the transaction is processed. | email | | `custom_mappings` | Dict[str, *Any*] | :heavy_minus_sign: | When custom mappings are configured on the resource, the result is included here. | | | `custom_fields` | List[[models.CustomField](../models/customfield.md)] | :heavy_minus_sign: | N/A | | diff --git a/docs/models/supplierinput.md b/docs/models/supplierinput.md index 6bbe2268..e6a5ad45 100644 --- a/docs/models/supplierinput.md +++ b/docs/models/supplierinput.md @@ -28,6 +28,7 @@ | `account` | [OptionalNullable[models.LinkedLedgerAccountInput]](../models/linkedledgeraccountinput.md) | :heavy_minus_sign: | N/A | | | `status` | [OptionalNullable[models.SupplierStatus]](../models/supplierstatus.md) | :heavy_minus_sign: | Supplier status | active | | `payment_method` | *OptionalNullable[str]* | :heavy_minus_sign: | Payment method used for the transaction, such as cash, credit card, bank transfer, or check | cash | +| `terms` | *OptionalNullable[str]* | :heavy_minus_sign: | Terms of payment. | Net 30 days | | `channel` | *OptionalNullable[str]* | :heavy_minus_sign: | The channel through which the transaction is processed. | email | | `custom_fields` | List[[models.CustomField](../models/customfield.md)] | :heavy_minus_sign: | N/A | | | `row_version` | *OptionalNullable[str]* | :heavy_minus_sign: | A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. | 1-12345 | diff --git a/docs/sdks/companies/README.md b/docs/sdks/companies/README.md index c487988d..423ce4bc 100644 --- a/docs/sdks/companies/README.md +++ b/docs/sdks/companies/README.md @@ -100,7 +100,7 @@ with Apideck( "bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", - "account_type": apideck_unify.AccountType.CREDIT_CARD, + "account_type": apideck_unify.BankAccount1AccountType.CREDIT_CARD, "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", @@ -113,7 +113,7 @@ with Apideck( "bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", - "account_type": apideck_unify.AccountType.CREDIT_CARD, + "account_type": apideck_unify.BankAccount1AccountType.CREDIT_CARD, "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", @@ -126,7 +126,7 @@ with Apideck( "bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", - "account_type": apideck_unify.AccountType.CREDIT_CARD, + "account_type": apideck_unify.BankAccount1AccountType.CREDIT_CARD, "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", @@ -289,7 +289,7 @@ with Apideck( | `acn` | *OptionalNullable[str]* | :heavy_minus_sign: | The Australian Company Number (ACN) is a nine digit number with the last digit being a check digit calculated using a modified modulus 10 calculation. ASIC has adopted a convention of always printing and displaying the ACN in the format XXX XXX XXX; three blocks of three characters, each block separated by a blank. | XXX XXX XXX | | `first_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The first name of the person. | Elon | | `last_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The last name of the person. | Musk | -| `bank_accounts` | List[[models.BankAccount](../../models/bankaccount.md)] | :heavy_minus_sign: | N/A | | +| `bank_accounts` | List[[models.BankAccount1](../../models/bankaccount1.md)] | :heavy_minus_sign: | N/A | | | `websites` | List[[models.Website](../../models/website.md)] | :heavy_minus_sign: | N/A | | | `addresses` | List[[models.Address](../../models/address.md)] | :heavy_minus_sign: | N/A | | | `social_links` | List[[models.SocialLink](../../models/sociallink.md)] | :heavy_minus_sign: | N/A | | @@ -396,7 +396,7 @@ with Apideck( "bank_name": "Monzo", "account_number": "123465", "account_name": "SPACEX LLC", - "account_type": apideck_unify.AccountType.CREDIT_CARD, + "account_type": apideck_unify.BankAccount1AccountType.CREDIT_CARD, "iban": "CH2989144532982975332", "bic": "AUDSCHGGXXX", "routing_number": "012345678", @@ -622,7 +622,7 @@ with Apideck( | `acn` | *OptionalNullable[str]* | :heavy_minus_sign: | The Australian Company Number (ACN) is a nine digit number with the last digit being a check digit calculated using a modified modulus 10 calculation. ASIC has adopted a convention of always printing and displaying the ACN in the format XXX XXX XXX; three blocks of three characters, each block separated by a blank. | XXX XXX XXX | | `first_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The first name of the person. | Elon | | `last_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The last name of the person. | Musk | -| `bank_accounts` | List[[models.BankAccount](../../models/bankaccount.md)] | :heavy_minus_sign: | N/A | | +| `bank_accounts` | List[[models.BankAccount1](../../models/bankaccount1.md)] | :heavy_minus_sign: | N/A | | | `websites` | List[[models.Website](../../models/website.md)] | :heavy_minus_sign: | N/A | | | `addresses` | List[[models.Address](../../models/address.md)] | :heavy_minus_sign: | N/A | | | `social_links` | List[[models.SocialLink](../../models/sociallink.md)] | :heavy_minus_sign: | N/A | | diff --git a/docs/sdks/suppliers/README.md b/docs/sdks/suppliers/README.md index d3a01845..6075ee69 100644 --- a/docs/sdks/suppliers/README.md +++ b/docs/sdks/suppliers/README.md @@ -187,7 +187,7 @@ with Apideck( "id": "123456", "nominal_code": "N091", "code": "453", - }, status=apideck_unify.SupplierStatus.ACTIVE, payment_method="cash", channel="email", custom_fields=[ + }, status=apideck_unify.SupplierStatus.ACTIVE, payment_method="cash", terms="Net 30 days", channel="email", custom_fields=[ { "id": "2389328923893298", "name": "employee_level", @@ -256,6 +256,7 @@ with Apideck( | `account` | [OptionalNullable[models.LinkedLedgerAccountInput]](../../models/linkedledgeraccountinput.md) | :heavy_minus_sign: | N/A | | | `status` | [OptionalNullable[models.SupplierStatus]](../../models/supplierstatus.md) | :heavy_minus_sign: | Supplier status | active | | `payment_method` | *OptionalNullable[str]* | :heavy_minus_sign: | Payment method used for the transaction, such as cash, credit card, bank transfer, or check | cash | +| `terms` | *OptionalNullable[str]* | :heavy_minus_sign: | Terms of payment. | Net 30 days | | `channel` | *OptionalNullable[str]* | :heavy_minus_sign: | The channel through which the transaction is processed. | email | | `custom_fields` | List[[models.CustomField](../../models/customfield.md)] | :heavy_minus_sign: | N/A | | | `row_version` | *OptionalNullable[str]* | :heavy_minus_sign: | A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. | 1-12345 | @@ -439,7 +440,7 @@ with Apideck( "id": "123456", "nominal_code": "N091", "code": "453", - }, status=apideck_unify.SupplierStatus.ACTIVE, payment_method="cash", channel="email", custom_fields=[ + }, status=apideck_unify.SupplierStatus.ACTIVE, payment_method="cash", terms="Net 30 days", channel="email", custom_fields=[ { "id": "2389328923893298", "name": "employee_level", @@ -527,6 +528,7 @@ with Apideck( | `account` | [OptionalNullable[models.LinkedLedgerAccountInput]](../../models/linkedledgeraccountinput.md) | :heavy_minus_sign: | N/A | | | `status` | [OptionalNullable[models.SupplierStatus]](../../models/supplierstatus.md) | :heavy_minus_sign: | Supplier status | active | | `payment_method` | *OptionalNullable[str]* | :heavy_minus_sign: | Payment method used for the transaction, such as cash, credit card, bank transfer, or check | cash | +| `terms` | *OptionalNullable[str]* | :heavy_minus_sign: | Terms of payment. | Net 30 days | | `channel` | *OptionalNullable[str]* | :heavy_minus_sign: | The channel through which the transaction is processed. | email | | `custom_fields` | List[[models.CustomField](../../models/customfield.md)] | :heavy_minus_sign: | N/A | | | `row_version` | *OptionalNullable[str]* | :heavy_minus_sign: | A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. | 1-12345 | diff --git a/pyproject.toml b/pyproject.toml index b2873a35..50df3724 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "apideck-unify" -version = "0.19.0" +version = "0.20.0" description = "Python Client SDK Generated by Speakeasy." authors = [{ name = "Speakeasy" },] readme = "README-PYPI.md" diff --git a/src/apideck_unify/_version.py b/src/apideck_unify/_version.py index 5fe088f3..246f2cc6 100644 --- a/src/apideck_unify/_version.py +++ b/src/apideck_unify/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "apideck-unify" -__version__: str = "0.19.0" -__openapi_doc_version__: str = "10.18.0" -__gen_version__: str = "2.638.1" -__user_agent__: str = "speakeasy-sdk/python 0.19.0 2.638.1 10.18.0 apideck-unify" +__version__: str = "0.20.0" +__openapi_doc_version__: str = "10.18.1" +__gen_version__: str = "2.654.2" +__user_agent__: str = "speakeasy-sdk/python 0.20.0 2.654.2 10.18.1 apideck-unify" try: if __package__ is not None: diff --git a/src/apideck_unify/activities.py b/src/apideck_unify/activities.py index aea2d127..e170d985 100644 --- a/src/apideck_unify/activities.py +++ b/src/apideck_unify/activities.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -151,64 +152,53 @@ def next_func() -> Optional[models.CrmActivitiesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmActivitiesAllResponse( - get_activities_response=utils.unmarshal_json( - http_res.text, Optional[models.GetActivitiesResponse] + get_activities_response=unmarshal_json_response( + Optional[models.GetActivitiesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmActivitiesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -351,64 +341,53 @@ def next_func() -> Optional[models.CrmActivitiesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmActivitiesAllResponse( - get_activities_response=utils.unmarshal_json( - http_res.text, Optional[models.GetActivitiesResponse] + get_activities_response=unmarshal_json_response( + Optional[models.GetActivitiesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmActivitiesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -658,62 +637,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.CrmActivitiesAddResponse( - create_activity_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateActivityResponse] + create_activity_response=unmarshal_json_response( + Optional[models.CreateActivityResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmActivitiesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -963,62 +931,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.CrmActivitiesAddResponse( - create_activity_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateActivityResponse] + create_activity_response=unmarshal_json_response( + Optional[models.CreateActivityResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmActivitiesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -1118,62 +1075,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmActivitiesOneResponse( - get_activity_response=utils.unmarshal_json( - http_res.text, Optional[models.GetActivityResponse] + get_activity_response=unmarshal_json_response( + Optional[models.GetActivityResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmActivitiesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1273,62 +1219,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmActivitiesOneResponse( - get_activity_response=utils.unmarshal_json( - http_res.text, Optional[models.GetActivityResponse] + get_activity_response=unmarshal_json_response( + Optional[models.GetActivityResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmActivitiesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1581,62 +1516,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmActivitiesUpdateResponse( - update_activity_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateActivityResponse] + update_activity_response=unmarshal_json_response( + Optional[models.UpdateActivityResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmActivitiesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1889,62 +1813,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmActivitiesUpdateResponse( - update_activity_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateActivityResponse] + update_activity_response=unmarshal_json_response( + Optional[models.UpdateActivityResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmActivitiesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -2041,62 +1954,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmActivitiesDeleteResponse( - delete_activity_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteActivityResponse] + delete_activity_response=unmarshal_json_response( + Optional[models.DeleteActivityResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmActivitiesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -2193,59 +2095,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmActivitiesDeleteResponse( - delete_activity_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteActivityResponse] + delete_activity_response=unmarshal_json_response( + Optional[models.DeleteActivityResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmActivitiesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/agedcreditors_sdk.py b/src/apideck_unify/agedcreditors_sdk.py index b393d855..4bf86498 100644 --- a/src/apideck_unify/agedcreditors_sdk.py +++ b/src/apideck_unify/agedcreditors_sdk.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Dict, Mapping, Optional, Union @@ -114,62 +115,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingAgedCreditorsOneResponse( - get_aged_creditors_response=utils.unmarshal_json( - http_res.text, Optional[models.GetAgedCreditorsResponse] + get_aged_creditors_response=unmarshal_json_response( + Optional[models.GetAgedCreditorsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingAgedCreditorsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -276,59 +266,48 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingAgedCreditorsOneResponse( - get_aged_creditors_response=utils.unmarshal_json( - http_res.text, Optional[models.GetAgedCreditorsResponse] + get_aged_creditors_response=unmarshal_json_response( + Optional[models.GetAgedCreditorsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingAgedCreditorsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/ageddebtors_sdk.py b/src/apideck_unify/ageddebtors_sdk.py index 8dbb6f2c..ed08f369 100644 --- a/src/apideck_unify/ageddebtors_sdk.py +++ b/src/apideck_unify/ageddebtors_sdk.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Dict, Mapping, Optional, Union @@ -114,62 +115,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingAgedDebtorsOneResponse( - get_aged_debtors_response=utils.unmarshal_json( - http_res.text, Optional[models.GetAgedDebtorsResponse] + get_aged_debtors_response=unmarshal_json_response( + Optional[models.GetAgedDebtorsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingAgedDebtorsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -276,59 +266,48 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingAgedDebtorsOneResponse( - get_aged_debtors_response=utils.unmarshal_json( - http_res.text, Optional[models.GetAgedDebtorsResponse] + get_aged_debtors_response=unmarshal_json_response( + Optional[models.GetAgedDebtorsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingAgedDebtorsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/apideck_companies.py b/src/apideck_unify/apideck_companies.py index 7ad81b3e..ae6b6f86 100644 --- a/src/apideck_unify/apideck_companies.py +++ b/src/apideck_unify/apideck_companies.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -137,64 +138,53 @@ def next_func() -> Optional[models.HrisCompaniesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisCompaniesAllResponse( - get_hris_companies_response=utils.unmarshal_json( - http_res.text, Optional[models.GetHrisCompaniesResponse] + get_hris_companies_response=unmarshal_json_response( + Optional[models.GetHrisCompaniesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisCompaniesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -323,64 +313,53 @@ def next_func() -> Optional[models.HrisCompaniesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisCompaniesAllResponse( - get_hris_companies_response=utils.unmarshal_json( - http_res.text, Optional[models.GetHrisCompaniesResponse] + get_hris_companies_response=unmarshal_json_response( + Optional[models.GetHrisCompaniesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisCompaniesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -531,62 +510,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.HrisCompaniesAddResponse( - create_hris_company_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateHrisCompanyResponse] + create_hris_company_response=unmarshal_json_response( + Optional[models.CreateHrisCompanyResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisCompaniesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -737,62 +705,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.HrisCompaniesAddResponse( - create_hris_company_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateHrisCompanyResponse] + create_hris_company_response=unmarshal_json_response( + Optional[models.CreateHrisCompanyResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisCompaniesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -892,62 +849,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisCompaniesOneResponse( - get_hris_company_response=utils.unmarshal_json( - http_res.text, Optional[models.GetHrisCompanyResponse] + get_hris_company_response=unmarshal_json_response( + Optional[models.GetHrisCompanyResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisCompaniesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1047,62 +993,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisCompaniesOneResponse( - get_hris_company_response=utils.unmarshal_json( - http_res.text, Optional[models.GetHrisCompanyResponse] + get_hris_company_response=unmarshal_json_response( + Optional[models.GetHrisCompanyResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisCompaniesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1256,62 +1191,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisCompaniesUpdateResponse( - update_hris_company_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateHrisCompanyResponse] + update_hris_company_response=unmarshal_json_response( + Optional[models.UpdateHrisCompanyResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisCompaniesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1465,62 +1389,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisCompaniesUpdateResponse( - update_hris_company_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateHrisCompanyResponse] + update_hris_company_response=unmarshal_json_response( + Optional[models.UpdateHrisCompanyResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisCompaniesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1617,62 +1530,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisCompaniesDeleteResponse( - delete_hris_company_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteHrisCompanyResponse] + delete_hris_company_response=unmarshal_json_response( + Optional[models.DeleteHrisCompanyResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisCompaniesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1769,59 +1671,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisCompaniesDeleteResponse( - delete_hris_company_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteHrisCompanyResponse] + delete_hris_company_response=unmarshal_json_response( + Optional[models.DeleteHrisCompanyResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisCompaniesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/apideck_customers.py b/src/apideck_unify/apideck_customers.py index 0d0c3d04..b4b0942e 100644 --- a/src/apideck_unify/apideck_customers.py +++ b/src/apideck_unify/apideck_customers.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -148,64 +149,53 @@ def next_func() -> Optional[models.EcommerceCustomersAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.EcommerceCustomersAllResponse( - get_ecommerce_customers_response=utils.unmarshal_json( - http_res.text, Optional[models.GetEcommerceCustomersResponse] + get_ecommerce_customers_response=unmarshal_json_response( + Optional[models.GetEcommerceCustomersResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.EcommerceCustomersAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -345,64 +335,53 @@ def next_func() -> Optional[models.EcommerceCustomersAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.EcommerceCustomersAllResponse( - get_ecommerce_customers_response=utils.unmarshal_json( - http_res.text, Optional[models.GetEcommerceCustomersResponse] + get_ecommerce_customers_response=unmarshal_json_response( + Optional[models.GetEcommerceCustomersResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.EcommerceCustomersAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -502,62 +481,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.EcommerceCustomersOneResponse( - get_ecommerce_customer_response=utils.unmarshal_json( - http_res.text, Optional[models.GetEcommerceCustomerResponse] + get_ecommerce_customer_response=unmarshal_json_response( + Optional[models.GetEcommerceCustomerResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.EcommerceCustomersOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -657,59 +625,48 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.EcommerceCustomersOneResponse( - get_ecommerce_customer_response=utils.unmarshal_json( - http_res.text, Optional[models.GetEcommerceCustomerResponse] + get_ecommerce_customer_response=unmarshal_json_response( + Optional[models.GetEcommerceCustomerResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.EcommerceCustomersOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/apideck_departments.py b/src/apideck_unify/apideck_departments.py index 503105cb..9983e2ff 100644 --- a/src/apideck_unify/apideck_departments.py +++ b/src/apideck_unify/apideck_departments.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -137,64 +138,53 @@ def next_func() -> Optional[models.HrisDepartmentsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisDepartmentsAllResponse( - get_departments_response=utils.unmarshal_json( - http_res.text, Optional[models.GetDepartmentsResponse] + get_departments_response=unmarshal_json_response( + Optional[models.GetDepartmentsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisDepartmentsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -323,64 +313,53 @@ def next_func() -> Optional[models.HrisDepartmentsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisDepartmentsAllResponse( - get_departments_response=utils.unmarshal_json( - http_res.text, Optional[models.GetDepartmentsResponse] + get_departments_response=unmarshal_json_response( + Optional[models.GetDepartmentsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisDepartmentsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -495,62 +474,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.HrisDepartmentsAddResponse( - create_department_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateDepartmentResponse] + create_department_response=unmarshal_json_response( + Optional[models.CreateDepartmentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisDepartmentsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -665,62 +633,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.HrisDepartmentsAddResponse( - create_department_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateDepartmentResponse] + create_department_response=unmarshal_json_response( + Optional[models.CreateDepartmentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisDepartmentsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -820,62 +777,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisDepartmentsOneResponse( - get_department_response=utils.unmarshal_json( - http_res.text, Optional[models.GetDepartmentResponse] + get_department_response=unmarshal_json_response( + Optional[models.GetDepartmentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisDepartmentsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -975,62 +921,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisDepartmentsOneResponse( - get_department_response=utils.unmarshal_json( - http_res.text, Optional[models.GetDepartmentResponse] + get_department_response=unmarshal_json_response( + Optional[models.GetDepartmentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisDepartmentsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1148,62 +1083,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisDepartmentsUpdateResponse( - update_department_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateDepartmentResponse] + update_department_response=unmarshal_json_response( + Optional[models.UpdateDepartmentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisDepartmentsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1321,62 +1245,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisDepartmentsUpdateResponse( - update_department_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateDepartmentResponse] + update_department_response=unmarshal_json_response( + Optional[models.UpdateDepartmentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisDepartmentsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1473,62 +1386,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisDepartmentsDeleteResponse( - delete_department_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteDepartmentResponse] + delete_department_response=unmarshal_json_response( + Optional[models.DeleteDepartmentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisDepartmentsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1625,59 +1527,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisDepartmentsDeleteResponse( - delete_department_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteDepartmentResponse] + delete_department_response=unmarshal_json_response( + Optional[models.DeleteDepartmentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisDepartmentsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/apiresourcecoverage_sdk.py b/src/apideck_unify/apiresourcecoverage_sdk.py index 139c0358..a2d3ee06 100644 --- a/src/apideck_unify/apiresourcecoverage_sdk.py +++ b/src/apideck_unify/apiresourcecoverage_sdk.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Mapping, Optional @@ -97,52 +98,41 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.ConnectorAPIResourceCoverageOneResponse( - get_api_resource_coverage_response=utils.unmarshal_json( - http_res.text, Optional[models.GetAPIResourceCoverageResponse] + get_api_resource_coverage_response=unmarshal_json_response( + Optional[models.GetAPIResourceCoverageResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.ConnectorAPIResourceCoverageOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -232,49 +222,38 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.ConnectorAPIResourceCoverageOneResponse( - get_api_resource_coverage_response=utils.unmarshal_json( - http_res.text, Optional[models.GetAPIResourceCoverageResponse] + get_api_resource_coverage_response=unmarshal_json_response( + Optional[models.GetAPIResourceCoverageResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.ConnectorAPIResourceCoverageOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/apiresources.py b/src/apideck_unify/apiresources.py index 107163e5..b61af208 100644 --- a/src/apideck_unify/apiresources.py +++ b/src/apideck_unify/apiresources.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Mapping, Optional @@ -97,52 +98,41 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.ConnectorAPIResourcesOneResponse( - get_api_resource_response=utils.unmarshal_json( - http_res.text, Optional[models.GetAPIResourceResponse] + get_api_resource_response=unmarshal_json_response( + Optional[models.GetAPIResourceResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.ConnectorAPIResourcesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -232,49 +222,38 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.ConnectorAPIResourcesOneResponse( - get_api_resource_response=utils.unmarshal_json( - http_res.text, Optional[models.GetAPIResourceResponse] + get_api_resource_response=unmarshal_json_response( + Optional[models.GetAPIResourceResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.ConnectorAPIResourcesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/apis.py b/src/apideck_unify/apis.py index 9d219df3..0c8a750d 100644 --- a/src/apideck_unify/apis.py +++ b/src/apideck_unify/apis.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -120,54 +121,43 @@ def next_func() -> Optional[models.ConnectorApisAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.ConnectorApisAllResponse( - get_apis_response=utils.unmarshal_json( - http_res.text, Optional[models.GetApisResponse] + get_apis_response=unmarshal_json_response( + Optional[models.GetApisResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.ConnectorApisAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -279,54 +269,43 @@ def next_func() -> Optional[models.ConnectorApisAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.ConnectorApisAllResponse( - get_apis_response=utils.unmarshal_json( - http_res.text, Optional[models.GetApisResponse] + get_apis_response=unmarshal_json_response( + Optional[models.GetApisResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.ConnectorApisAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -413,52 +392,41 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.ConnectorApisOneResponse( - get_api_response=utils.unmarshal_json( - http_res.text, Optional[models.GetAPIResponse] + get_api_response=unmarshal_json_response( + Optional[models.GetAPIResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.ConnectorApisOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -545,49 +513,38 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.ConnectorApisOneResponse( - get_api_response=utils.unmarshal_json( - http_res.text, Optional[models.GetAPIResponse] + get_api_response=unmarshal_json_response( + Optional[models.GetAPIResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.ConnectorApisOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/applicants.py b/src/apideck_unify/applicants.py index aecb6476..2390f364 100644 --- a/src/apideck_unify/applicants.py +++ b/src/apideck_unify/applicants.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from datetime import date from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -146,64 +147,53 @@ def next_func() -> Optional[models.AtsApplicantsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AtsApplicantsAllResponse( - get_applicants_response=utils.unmarshal_json( - http_res.text, Optional[models.GetApplicantsResponse] + get_applicants_response=unmarshal_json_response( + Optional[models.GetApplicantsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsApplicantsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -340,64 +330,53 @@ def next_func() -> Optional[models.AtsApplicantsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AtsApplicantsAllResponse( - get_applicants_response=utils.unmarshal_json( - http_res.text, Optional[models.GetApplicantsResponse] + get_applicants_response=unmarshal_json_response( + Optional[models.GetApplicantsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsApplicantsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -613,62 +592,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AtsApplicantsAddResponse( - create_applicant_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateApplicantResponse] + create_applicant_response=unmarshal_json_response( + Optional[models.CreateApplicantResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsApplicantsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -884,62 +852,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AtsApplicantsAddResponse( - create_applicant_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateApplicantResponse] + create_applicant_response=unmarshal_json_response( + Optional[models.CreateApplicantResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsApplicantsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -1039,62 +996,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AtsApplicantsOneResponse( - get_applicant_response=utils.unmarshal_json( - http_res.text, Optional[models.GetApplicantResponse] + get_applicant_response=unmarshal_json_response( + Optional[models.GetApplicantResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsApplicantsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1194,62 +1140,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AtsApplicantsOneResponse( - get_applicant_response=utils.unmarshal_json( - http_res.text, Optional[models.GetApplicantResponse] + get_applicant_response=unmarshal_json_response( + Optional[models.GetApplicantResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsApplicantsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1468,62 +1403,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AtsApplicantsUpdateResponse( - update_applicant_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateApplicantResponse] + update_applicant_response=unmarshal_json_response( + Optional[models.UpdateApplicantResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsApplicantsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1742,62 +1666,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AtsApplicantsUpdateResponse( - update_applicant_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateApplicantResponse] + update_applicant_response=unmarshal_json_response( + Optional[models.UpdateApplicantResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsApplicantsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1894,62 +1807,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AtsApplicantsDeleteResponse( - delete_applicant_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteApplicantResponse] + delete_applicant_response=unmarshal_json_response( + Optional[models.DeleteApplicantResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsApplicantsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -2046,59 +1948,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AtsApplicantsDeleteResponse( - delete_applicant_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteApplicantResponse] + delete_applicant_response=unmarshal_json_response( + Optional[models.DeleteApplicantResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsApplicantsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/applications.py b/src/apideck_unify/applications.py index 209a1f8d..181bcd0b 100644 --- a/src/apideck_unify/applications.py +++ b/src/apideck_unify/applications.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -133,64 +134,53 @@ def next_func() -> Optional[models.AtsApplicationsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AtsApplicationsAllResponse( - get_applications_response=utils.unmarshal_json( - http_res.text, Optional[models.GetApplicationsResponse] + get_applications_response=unmarshal_json_response( + Optional[models.GetApplicationsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsApplicationsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -315,64 +305,53 @@ def next_func() -> Optional[models.AtsApplicationsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AtsApplicationsAllResponse( - get_applications_response=utils.unmarshal_json( - http_res.text, Optional[models.GetApplicationsResponse] + get_applications_response=unmarshal_json_response( + Optional[models.GetApplicationsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsApplicationsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -490,62 +469,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AtsApplicationsAddResponse( - create_application_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateApplicationResponse] + create_application_response=unmarshal_json_response( + Optional[models.CreateApplicationResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsApplicationsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -663,62 +631,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AtsApplicationsAddResponse( - create_application_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateApplicationResponse] + create_application_response=unmarshal_json_response( + Optional[models.CreateApplicationResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsApplicationsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -815,62 +772,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AtsApplicationsOneResponse( - get_application_response=utils.unmarshal_json( - http_res.text, Optional[models.GetApplicationResponse] + get_application_response=unmarshal_json_response( + Optional[models.GetApplicationResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsApplicationsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -967,62 +913,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AtsApplicationsOneResponse( - get_application_response=utils.unmarshal_json( - http_res.text, Optional[models.GetApplicationResponse] + get_application_response=unmarshal_json_response( + Optional[models.GetApplicationResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsApplicationsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1143,62 +1078,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AtsApplicationsUpdateResponse( - update_application_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateApplicationResponse] + update_application_response=unmarshal_json_response( + Optional[models.UpdateApplicationResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsApplicationsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1319,62 +1243,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AtsApplicationsUpdateResponse( - update_application_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateApplicationResponse] + update_application_response=unmarshal_json_response( + Optional[models.UpdateApplicationResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsApplicationsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1471,62 +1384,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AtsApplicationsDeleteResponse( - delete_application_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteApplicationResponse] + delete_application_response=unmarshal_json_response( + Optional[models.DeleteApplicationResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsApplicationsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1623,59 +1525,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AtsApplicationsDeleteResponse( - delete_application_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteApplicationResponse] + delete_application_response=unmarshal_json_response( + Optional[models.DeleteApplicationResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsApplicationsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/attachments.py b/src/apideck_unify/attachments.py index 70110c19..e452338b 100644 --- a/src/apideck_unify/attachments.py +++ b/src/apideck_unify/attachments.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from enum import Enum import io from jsonpath import JSONPath @@ -148,64 +149,53 @@ def next_func() -> Optional[models.AccountingAttachmentsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingAttachmentsAllResponse( - get_attachments_response=utils.unmarshal_json( - http_res.text, Optional[models.GetAttachmentsResponse] + get_attachments_response=unmarshal_json_response( + Optional[models.GetAttachmentsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingAttachmentsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -338,64 +328,53 @@ def next_func() -> Optional[models.AccountingAttachmentsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingAttachmentsAllResponse( - get_attachments_response=utils.unmarshal_json( - http_res.text, Optional[models.GetAttachmentsResponse] + get_attachments_response=unmarshal_json_response( + Optional[models.GetAttachmentsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingAttachmentsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def upload( self, @@ -508,62 +487,51 @@ def upload( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingAttachmentsUploadResponse( - create_attachment_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateAttachmentResponse] + create_attachment_response=unmarshal_json_response( + Optional[models.CreateAttachmentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingAttachmentsUploadResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def upload_async( self, @@ -676,62 +644,51 @@ async def upload_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingAttachmentsUploadResponse( - create_attachment_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateAttachmentResponse] + create_attachment_response=unmarshal_json_response( + Optional[models.CreateAttachmentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingAttachmentsUploadResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -837,62 +794,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingAttachmentsOneResponse( - get_attachment_response=utils.unmarshal_json( - http_res.text, Optional[models.GetAttachmentResponse] + get_attachment_response=unmarshal_json_response( + Optional[models.GetAttachmentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingAttachmentsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -998,62 +944,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingAttachmentsOneResponse( - get_attachment_response=utils.unmarshal_json( - http_res.text, Optional[models.GetAttachmentResponse] + get_attachment_response=unmarshal_json_response( + Optional[models.GetAttachmentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingAttachmentsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1156,62 +1091,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingAttachmentsDeleteResponse( - delete_attachment_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteAttachmentResponse] + delete_attachment_response=unmarshal_json_response( + Optional[models.DeleteAttachmentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingAttachmentsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1314,62 +1238,51 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingAttachmentsDeleteResponse( - delete_attachment_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteAttachmentResponse] + delete_attachment_response=unmarshal_json_response( + Optional[models.DeleteAttachmentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingAttachmentsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def download( self, @@ -1482,61 +1395,51 @@ def download( ) if utils.match_response(http_res, "400", "application/json"): http_res_text = utils.stream_to_text(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res, http_res_text ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "401", "application/json"): http_res_text = utils.stream_to_text(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res, http_res_text ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "402", "application/json"): http_res_text = utils.stream_to_text(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res, http_res_text ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "404", "application/json"): http_res_text = utils.stream_to_text(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res, http_res_text ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "422", "application/json"): http_res_text = utils.stream_to_text(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res, http_res_text ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): - http_response_text = utils.stream_to_text(http_res) + http_res_text = utils.stream_to_text(http_res) return models.AccountingAttachmentsDownloadResponse( - unexpected_error_response=utils.unmarshal_json( - http_response_text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res, http_res_text ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res, http_res_text) async def download_async( self, @@ -1649,58 +1552,48 @@ async def download_async( ) if utils.match_response(http_res, "400", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res, http_res_text ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "401", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res, http_res_text ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "402", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res, http_res_text ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "404", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res, http_res_text ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "422", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res, http_res_text ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): - http_response_text = await utils.stream_to_text_async(http_res) + http_res_text = await utils.stream_to_text_async(http_res) return models.AccountingAttachmentsDownloadResponse( - unexpected_error_response=utils.unmarshal_json( - http_response_text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res, http_res_text ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res, http_res_text) diff --git a/src/apideck_unify/balancesheet_sdk.py b/src/apideck_unify/balancesheet_sdk.py index 2f6a02fd..22da279f 100644 --- a/src/apideck_unify/balancesheet_sdk.py +++ b/src/apideck_unify/balancesheet_sdk.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Dict, Mapping, Optional, Union @@ -111,62 +112,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBalanceSheetOneResponse( - get_balance_sheet_response=utils.unmarshal_json( - http_res.text, Optional[models.GetBalanceSheetResponse] + get_balance_sheet_response=unmarshal_json_response( + Optional[models.GetBalanceSheetResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBalanceSheetOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -270,59 +260,48 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBalanceSheetOneResponse( - get_balance_sheet_response=utils.unmarshal_json( - http_res.text, Optional[models.GetBalanceSheetResponse] + get_balance_sheet_response=unmarshal_json_response( + Optional[models.GetBalanceSheetResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBalanceSheetOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/bankfeedaccounts.py b/src/apideck_unify/bankfeedaccounts.py index b9b3cf0a..bff9cbc4 100644 --- a/src/apideck_unify/bankfeedaccounts.py +++ b/src/apideck_unify/bankfeedaccounts.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -137,64 +138,53 @@ def next_func() -> Optional[models.AccountingBankFeedAccountsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBankFeedAccountsAllResponse( - get_bank_feed_accounts_response=utils.unmarshal_json( - http_res.text, Optional[models.GetBankFeedAccountsResponse] + get_bank_feed_accounts_response=unmarshal_json_response( + Optional[models.GetBankFeedAccountsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBankFeedAccountsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -323,64 +313,53 @@ def next_func() -> Optional[models.AccountingBankFeedAccountsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBankFeedAccountsAllResponse( - get_bank_feed_accounts_response=utils.unmarshal_json( - http_res.text, Optional[models.GetBankFeedAccountsResponse] + get_bank_feed_accounts_response=unmarshal_json_response( + Optional[models.GetBankFeedAccountsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBankFeedAccountsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -514,62 +493,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingBankFeedAccountsAddResponse( - create_bank_feed_account_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateBankFeedAccountResponse] + create_bank_feed_account_response=unmarshal_json_response( + Optional[models.CreateBankFeedAccountResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBankFeedAccountsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -703,62 +671,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingBankFeedAccountsAddResponse( - create_bank_feed_account_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateBankFeedAccountResponse] + create_bank_feed_account_response=unmarshal_json_response( + Optional[models.CreateBankFeedAccountResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBankFeedAccountsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -858,62 +815,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBankFeedAccountsOneResponse( - get_bank_feed_account_response=utils.unmarshal_json( - http_res.text, Optional[models.GetBankFeedAccountResponse] + get_bank_feed_account_response=unmarshal_json_response( + Optional[models.GetBankFeedAccountResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBankFeedAccountsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1013,62 +959,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBankFeedAccountsOneResponse( - get_bank_feed_account_response=utils.unmarshal_json( - http_res.text, Optional[models.GetBankFeedAccountResponse] + get_bank_feed_account_response=unmarshal_json_response( + Optional[models.GetBankFeedAccountResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBankFeedAccountsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1205,62 +1140,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBankFeedAccountsUpdateResponse( - update_bank_feed_account_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateBankFeedAccountResponse] + update_bank_feed_account_response=unmarshal_json_response( + Optional[models.UpdateBankFeedAccountResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBankFeedAccountsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1397,62 +1321,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBankFeedAccountsUpdateResponse( - update_bank_feed_account_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateBankFeedAccountResponse] + update_bank_feed_account_response=unmarshal_json_response( + Optional[models.UpdateBankFeedAccountResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBankFeedAccountsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1549,62 +1462,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBankFeedAccountsDeleteResponse( - delete_bank_feed_account_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteBankFeedAccountResponse] + delete_bank_feed_account_response=unmarshal_json_response( + Optional[models.DeleteBankFeedAccountResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBankFeedAccountsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1701,59 +1603,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBankFeedAccountsDeleteResponse( - delete_bank_feed_account_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteBankFeedAccountResponse] + delete_bank_feed_account_response=unmarshal_json_response( + Optional[models.DeleteBankFeedAccountResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBankFeedAccountsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/bankfeedstatements.py b/src/apideck_unify/bankfeedstatements.py index ddcff3f3..eb06634f 100644 --- a/src/apideck_unify/bankfeedstatements.py +++ b/src/apideck_unify/bankfeedstatements.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from datetime import datetime from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -138,64 +139,53 @@ def next_func() -> Optional[models.AccountingBankFeedStatementsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBankFeedStatementsAllResponse( - get_bank_feed_statements_response=utils.unmarshal_json( - http_res.text, Optional[models.GetBankFeedStatementsResponse] + get_bank_feed_statements_response=unmarshal_json_response( + Optional[models.GetBankFeedStatementsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBankFeedStatementsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -324,64 +314,53 @@ def next_func() -> Optional[models.AccountingBankFeedStatementsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBankFeedStatementsAllResponse( - get_bank_feed_statements_response=utils.unmarshal_json( - http_res.text, Optional[models.GetBankFeedStatementsResponse] + get_bank_feed_statements_response=unmarshal_json_response( + Optional[models.GetBankFeedStatementsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBankFeedStatementsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -515,62 +494,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingBankFeedStatementsAddResponse( - create_bank_feed_statement_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateBankFeedStatementResponse] + create_bank_feed_statement_response=unmarshal_json_response( + Optional[models.CreateBankFeedStatementResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBankFeedStatementsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -704,62 +672,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingBankFeedStatementsAddResponse( - create_bank_feed_statement_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateBankFeedStatementResponse] + create_bank_feed_statement_response=unmarshal_json_response( + Optional[models.CreateBankFeedStatementResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBankFeedStatementsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -859,62 +816,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBankFeedStatementsOneResponse( - get_bank_feed_statement_response=utils.unmarshal_json( - http_res.text, Optional[models.GetBankFeedStatementResponse] + get_bank_feed_statement_response=unmarshal_json_response( + Optional[models.GetBankFeedStatementResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBankFeedStatementsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1014,62 +960,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBankFeedStatementsOneResponse( - get_bank_feed_statement_response=utils.unmarshal_json( - http_res.text, Optional[models.GetBankFeedStatementResponse] + get_bank_feed_statement_response=unmarshal_json_response( + Optional[models.GetBankFeedStatementResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBankFeedStatementsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1206,62 +1141,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBankFeedStatementsUpdateResponse( - update_bank_feed_statement_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateBankFeedStatementResponse] + update_bank_feed_statement_response=unmarshal_json_response( + Optional[models.UpdateBankFeedStatementResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBankFeedStatementsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1398,62 +1322,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBankFeedStatementsUpdateResponse( - update_bank_feed_statement_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateBankFeedStatementResponse] + update_bank_feed_statement_response=unmarshal_json_response( + Optional[models.UpdateBankFeedStatementResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBankFeedStatementsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1550,62 +1463,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBankFeedStatementsDeleteResponse( - delete_bank_feed_statement_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteBankFeedStatementResponse] + delete_bank_feed_statement_response=unmarshal_json_response( + Optional[models.DeleteBankFeedStatementResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBankFeedStatementsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1702,59 +1604,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBankFeedStatementsDeleteResponse( - delete_bank_feed_statement_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteBankFeedStatementResponse] + delete_bank_feed_statement_response=unmarshal_json_response( + Optional[models.DeleteBankFeedStatementResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBankFeedStatementsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/basesdk.py b/src/apideck_unify/basesdk.py index ed2abb2b..3fd64b59 100644 --- a/src/apideck_unify/basesdk.py +++ b/src/apideck_unify/basesdk.py @@ -244,7 +244,7 @@ def do(): if http_res is None: logger.debug("Raising no response SDK error") - raise models.APIError("No response received") + raise models.NoResponseError("No response received") logger.debug( "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", @@ -265,7 +265,7 @@ def do(): http_res = result else: logger.debug("Raising unexpected SDK error") - raise models.APIError("Unexpected error occurred") + raise models.APIError("Unexpected error occurred", http_res) return http_res @@ -316,7 +316,7 @@ async def do(): if http_res is None: logger.debug("Raising no response SDK error") - raise models.APIError("No response received") + raise models.NoResponseError("No response received") logger.debug( "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", @@ -337,7 +337,7 @@ async def do(): http_res = result else: logger.debug("Raising unexpected SDK error") - raise models.APIError("Unexpected error occurred") + raise models.APIError("Unexpected error occurred", http_res) return http_res diff --git a/src/apideck_unify/billpayments.py b/src/apideck_unify/billpayments.py index c4a9e3d1..583b24be 100644 --- a/src/apideck_unify/billpayments.py +++ b/src/apideck_unify/billpayments.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from datetime import datetime from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -148,64 +149,53 @@ def next_func() -> Optional[models.AccountingBillPaymentsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBillPaymentsAllResponse( - get_bill_payments_response=utils.unmarshal_json( - http_res.text, Optional[models.GetBillPaymentsResponse] + get_bill_payments_response=unmarshal_json_response( + Optional[models.GetBillPaymentsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBillPaymentsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -344,64 +334,53 @@ def next_func() -> Optional[models.AccountingBillPaymentsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBillPaymentsAllResponse( - get_bill_payments_response=utils.unmarshal_json( - http_res.text, Optional[models.GetBillPaymentsResponse] + get_bill_payments_response=unmarshal_json_response( + Optional[models.GetBillPaymentsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBillPaymentsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -600,62 +579,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingBillPaymentsAddResponse( - create_bill_payment_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateBillPaymentResponse] + create_bill_payment_response=unmarshal_json_response( + Optional[models.CreateBillPaymentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBillPaymentsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -854,62 +822,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingBillPaymentsAddResponse( - create_bill_payment_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateBillPaymentResponse] + create_bill_payment_response=unmarshal_json_response( + Optional[models.CreateBillPaymentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBillPaymentsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -1009,62 +966,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBillPaymentsOneResponse( - get_bill_payment_response=utils.unmarshal_json( - http_res.text, Optional[models.GetBillPaymentResponse] + get_bill_payment_response=unmarshal_json_response( + Optional[models.GetBillPaymentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBillPaymentsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1164,62 +1110,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBillPaymentsOneResponse( - get_bill_payment_response=utils.unmarshal_json( - http_res.text, Optional[models.GetBillPaymentResponse] + get_bill_payment_response=unmarshal_json_response( + Optional[models.GetBillPaymentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBillPaymentsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1421,62 +1356,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBillPaymentsUpdateResponse( - update_bill_payment_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateBillPaymentResponse] + update_bill_payment_response=unmarshal_json_response( + Optional[models.UpdateBillPaymentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBillPaymentsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1678,62 +1602,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBillPaymentsUpdateResponse( - update_bill_payment_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateBillPaymentResponse] + update_bill_payment_response=unmarshal_json_response( + Optional[models.UpdateBillPaymentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBillPaymentsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1830,62 +1743,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBillPaymentsDeleteResponse( - delete_bill_payment_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteBillPaymentResponse] + delete_bill_payment_response=unmarshal_json_response( + Optional[models.DeleteBillPaymentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBillPaymentsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1982,59 +1884,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBillPaymentsDeleteResponse( - delete_bill_payment_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteBillPaymentResponse] + delete_bill_payment_response=unmarshal_json_response( + Optional[models.DeleteBillPaymentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBillPaymentsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/bills.py b/src/apideck_unify/bills.py index 587d2b40..5b591d38 100644 --- a/src/apideck_unify/bills.py +++ b/src/apideck_unify/bills.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from datetime import date from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -148,64 +149,53 @@ def next_func() -> Optional[models.AccountingBillsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBillsAllResponse( - get_bills_response=utils.unmarshal_json( - http_res.text, Optional[models.GetBillsResponse] + get_bills_response=unmarshal_json_response( + Optional[models.GetBillsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBillsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -344,64 +334,53 @@ def next_func() -> Optional[models.AccountingBillsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBillsAllResponse( - get_bills_response=utils.unmarshal_json( - http_res.text, Optional[models.GetBillsResponse] + get_bills_response=unmarshal_json_response( + Optional[models.GetBillsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBillsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -639,62 +618,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingBillsAddResponse( - create_bill_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateBillResponse] + create_bill_response=unmarshal_json_response( + Optional[models.CreateBillResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBillsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -932,62 +900,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingBillsAddResponse( - create_bill_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateBillResponse] + create_bill_response=unmarshal_json_response( + Optional[models.CreateBillResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBillsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -1087,62 +1044,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBillsOneResponse( - get_bill_response=utils.unmarshal_json( - http_res.text, Optional[models.GetBillResponse] + get_bill_response=unmarshal_json_response( + Optional[models.GetBillResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBillsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1242,62 +1188,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBillsOneResponse( - get_bill_response=utils.unmarshal_json( - http_res.text, Optional[models.GetBillResponse] + get_bill_response=unmarshal_json_response( + Optional[models.GetBillResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBillsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1538,62 +1473,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBillsUpdateResponse( - update_bill_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateBillResponse] + update_bill_response=unmarshal_json_response( + Optional[models.UpdateBillResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBillsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1834,62 +1758,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBillsUpdateResponse( - update_bill_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateBillResponse] + update_bill_response=unmarshal_json_response( + Optional[models.UpdateBillResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBillsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1986,62 +1899,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBillsDeleteResponse( - delete_bill_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteBillResponse] + delete_bill_response=unmarshal_json_response( + Optional[models.DeleteBillResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBillsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -2138,59 +2040,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingBillsDeleteResponse( - delete_bill_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteBillResponse] + delete_bill_response=unmarshal_json_response( + Optional[models.DeleteBillResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingBillsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/categories.py b/src/apideck_unify/categories.py index d2ba71e3..8b35a2f3 100644 --- a/src/apideck_unify/categories.py +++ b/src/apideck_unify/categories.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -133,64 +134,53 @@ def next_func() -> Optional[models.AccountingCategoriesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingCategoriesAllResponse( - get_categories_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCategoriesResponse] + get_categories_response=unmarshal_json_response( + Optional[models.GetCategoriesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCategoriesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -315,64 +305,53 @@ def next_func() -> Optional[models.AccountingCategoriesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingCategoriesAllResponse( - get_categories_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCategoriesResponse] + get_categories_response=unmarshal_json_response( + Optional[models.GetCategoriesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCategoriesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -472,62 +451,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingCategoriesOneResponse( - get_category_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCategoryResponse] + get_category_response=unmarshal_json_response( + Optional[models.GetCategoryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCategoriesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -627,59 +595,48 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingCategoriesOneResponse( - get_category_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCategoryResponse] + get_category_response=unmarshal_json_response( + Optional[models.GetCategoryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCategoriesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/collections.py b/src/apideck_unify/collections.py index 5fbc742d..e9f851aa 100644 --- a/src/apideck_unify/collections.py +++ b/src/apideck_unify/collections.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -143,64 +144,53 @@ def next_func() -> Optional[models.IssueTrackingCollectionsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionsAllResponse( - get_collections_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCollectionsResponse] + get_collections_response=unmarshal_json_response( + Optional[models.GetCollectionsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -335,64 +325,53 @@ def next_func() -> Optional[models.IssueTrackingCollectionsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionsAllResponse( - get_collections_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCollectionsResponse] + get_collections_response=unmarshal_json_response( + Optional[models.GetCollectionsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -492,62 +471,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionsOneResponse( - get_collection_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCollectionResponse] + get_collection_response=unmarshal_json_response( + Optional[models.GetCollectionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -647,59 +615,48 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionsOneResponse( - get_collection_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCollectionResponse] + get_collection_response=unmarshal_json_response( + Optional[models.GetCollectionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/collectiontags.py b/src/apideck_unify/collectiontags.py index 882f5b46..120d8df8 100644 --- a/src/apideck_unify/collectiontags.py +++ b/src/apideck_unify/collectiontags.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -141,64 +142,53 @@ def next_func() -> Optional[models.IssueTrackingCollectionTagsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionTagsAllResponse( - get_collection_tags_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCollectionTagsResponse] + get_collection_tags_response=unmarshal_json_response( + Optional[models.GetCollectionTagsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionTagsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -331,61 +321,50 @@ def next_func() -> Optional[models.IssueTrackingCollectionTagsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionTagsAllResponse( - get_collection_tags_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCollectionTagsResponse] + get_collection_tags_response=unmarshal_json_response( + Optional[models.GetCollectionTagsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionTagsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/collectionticketcomments.py b/src/apideck_unify/collectionticketcomments.py index 95650307..defcb388 100644 --- a/src/apideck_unify/collectionticketcomments.py +++ b/src/apideck_unify/collectionticketcomments.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -151,64 +152,53 @@ def next_func() -> ( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionTicketCommentsAllResponse( - get_comments_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCommentsResponse] + get_comments_response=unmarshal_json_response( + Optional[models.GetCommentsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionTicketCommentsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -351,64 +341,53 @@ def next_func() -> ( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionTicketCommentsAllResponse( - get_comments_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCommentsResponse] + get_comments_response=unmarshal_json_response( + Optional[models.GetCommentsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionTicketCommentsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -527,62 +506,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.IssueTrackingCollectionTicketCommentsAddResponse( - create_comment_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateCommentResponse] + create_comment_response=unmarshal_json_response( + Optional[models.CreateCommentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionTicketCommentsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -701,62 +669,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.IssueTrackingCollectionTicketCommentsAddResponse( - create_comment_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateCommentResponse] + create_comment_response=unmarshal_json_response( + Optional[models.CreateCommentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionTicketCommentsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -895,64 +852,53 @@ def next_func() -> ( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionTicketCommentsOneResponse( - get_comment_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCommentResponse] + get_comment_response=unmarshal_json_response( + Optional[models.GetCommentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionTicketCommentsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1091,64 +1037,53 @@ def next_func() -> ( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionTicketCommentsOneResponse( - get_comment_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCommentResponse] + get_comment_response=unmarshal_json_response( + Optional[models.GetCommentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionTicketCommentsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1270,62 +1205,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionTicketCommentsUpdateResponse( - update_comment_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateCommentResponse] + update_comment_response=unmarshal_json_response( + Optional[models.UpdateCommentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionTicketCommentsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1447,62 +1371,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionTicketCommentsUpdateResponse( - update_comment_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateCommentResponse] + update_comment_response=unmarshal_json_response( + Optional[models.UpdateCommentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionTicketCommentsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1605,62 +1518,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionTicketCommentsDeleteResponse( - delete_comment_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteCommentResponse] + delete_comment_response=unmarshal_json_response( + Optional[models.DeleteCommentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionTicketCommentsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1763,59 +1665,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionTicketCommentsDeleteResponse( - delete_comment_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteCommentResponse] + delete_comment_response=unmarshal_json_response( + Optional[models.DeleteCommentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionTicketCommentsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/collectiontickets.py b/src/apideck_unify/collectiontickets.py index dfa127ee..6c07676c 100644 --- a/src/apideck_unify/collectiontickets.py +++ b/src/apideck_unify/collectiontickets.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from datetime import datetime from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -152,64 +153,53 @@ def next_func() -> Optional[models.IssueTrackingCollectionTicketsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionTicketsAllResponse( - get_tickets_response=utils.unmarshal_json( - http_res.text, Optional[models.GetTicketsResponse] + get_tickets_response=unmarshal_json_response( + Optional[models.GetTicketsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionTicketsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -352,64 +342,53 @@ def next_func() -> Optional[models.IssueTrackingCollectionTicketsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionTicketsAllResponse( - get_tickets_response=utils.unmarshal_json( - http_res.text, Optional[models.GetTicketsResponse] + get_tickets_response=unmarshal_json_response( + Optional[models.GetTicketsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionTicketsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -556,62 +535,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.IssueTrackingCollectionTicketsAddResponse( - create_ticket_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateTicketResponse] + create_ticket_response=unmarshal_json_response( + Optional[models.CreateTicketResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionTicketsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -758,62 +726,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.IssueTrackingCollectionTicketsAddResponse( - create_ticket_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateTicketResponse] + create_ticket_response=unmarshal_json_response( + Optional[models.CreateTicketResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionTicketsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -916,62 +873,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionTicketsOneResponse( - get_ticket_response=utils.unmarshal_json( - http_res.text, Optional[models.GetTicketResponse] + get_ticket_response=unmarshal_json_response( + Optional[models.GetTicketResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionTicketsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1074,62 +1020,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionTicketsOneResponse( - get_ticket_response=utils.unmarshal_json( - http_res.text, Optional[models.GetTicketResponse] + get_ticket_response=unmarshal_json_response( + Optional[models.GetTicketResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionTicketsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1279,62 +1214,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionTicketsUpdateResponse( - update_ticket_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateTicketResponse] + update_ticket_response=unmarshal_json_response( + Optional[models.UpdateTicketResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionTicketsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1484,62 +1408,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionTicketsUpdateResponse( - update_ticket_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateTicketResponse] + update_ticket_response=unmarshal_json_response( + Optional[models.UpdateTicketResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionTicketsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1639,62 +1552,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionTicketsDeleteResponse( - delete_ticket_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteTicketResponse] + delete_ticket_response=unmarshal_json_response( + Optional[models.DeleteTicketResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionTicketsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1794,59 +1696,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionTicketsDeleteResponse( - delete_ticket_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteTicketResponse] + delete_ticket_response=unmarshal_json_response( + Optional[models.DeleteTicketResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionTicketsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/collectionusers.py b/src/apideck_unify/collectionusers.py index d0def243..a2b446f9 100644 --- a/src/apideck_unify/collectionusers.py +++ b/src/apideck_unify/collectionusers.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -141,64 +142,53 @@ def next_func() -> Optional[models.IssueTrackingCollectionUsersAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionUsersAllResponse( - get_collection_users_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCollectionUsersResponse] + get_collection_users_response=unmarshal_json_response( + Optional[models.GetCollectionUsersResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionUsersAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -331,64 +321,53 @@ def next_func() -> Optional[models.IssueTrackingCollectionUsersAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionUsersAllResponse( - get_collection_users_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCollectionUsersResponse] + get_collection_users_response=unmarshal_json_response( + Optional[models.GetCollectionUsersResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionUsersAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -491,62 +470,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionUsersOneResponse( - get_collection_user_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCollectionUserResponse] + get_collection_user_response=unmarshal_json_response( + Optional[models.GetCollectionUserResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionUsersOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -649,59 +617,48 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.IssueTrackingCollectionUsersOneResponse( - get_collection_user_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCollectionUserResponse] + get_collection_user_response=unmarshal_json_response( + Optional[models.GetCollectionUserResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.IssueTrackingCollectionUsersOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/companies.py b/src/apideck_unify/companies.py index 39380ce6..f7023a36 100644 --- a/src/apideck_unify/companies.py +++ b/src/apideck_unify/companies.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from datetime import date from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -150,64 +151,53 @@ def next_func() -> Optional[models.CrmCompaniesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCompaniesAllResponse( - get_companies_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCompaniesResponse] + get_companies_response=unmarshal_json_response( + Optional[models.GetCompaniesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCompaniesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -348,64 +338,53 @@ def next_func() -> Optional[models.CrmCompaniesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCompaniesAllResponse( - get_companies_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCompaniesResponse] + get_companies_response=unmarshal_json_response( + Optional[models.GetCompaniesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCompaniesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -434,7 +413,7 @@ def create( first_name: OptionalNullable[str] = UNSET, last_name: OptionalNullable[str] = UNSET, bank_accounts: Optional[ - Union[List[models.BankAccount], List[models.BankAccountTypedDict]] + Union[List[models.BankAccount1], List[models.BankAccount1TypedDict]] ] = None, websites: Optional[ Union[List[models.Website], List[models.WebsiteTypedDict]] @@ -527,7 +506,7 @@ def create( consumer_id=consumer_id, app_id=app_id, service_id=service_id, - company=models.CompanyInput( + company1=models.Company1Input( name=name, owner_id=owner_id, image=image, @@ -548,7 +527,7 @@ def create( first_name=first_name, last_name=last_name, bank_accounts=utils.get_pydantic_model( - bank_accounts, Optional[List[models.BankAccount]] + bank_accounts, Optional[List[models.BankAccount1]] ), websites=utils.get_pydantic_model( websites, Optional[List[models.Website]] @@ -597,7 +576,7 @@ def create( ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.company, False, False, "json", models.CompanyInput + request.company1, False, False, "json", models.Company1Input ), timeout_ms=timeout_ms, ) @@ -632,62 +611,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.CrmCompaniesAddResponse( - create_company_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateCompanyResponse] + create_company_response=unmarshal_json_response( + Optional[models.CreateCompanyResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCompaniesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -716,7 +684,7 @@ async def create_async( first_name: OptionalNullable[str] = UNSET, last_name: OptionalNullable[str] = UNSET, bank_accounts: Optional[ - Union[List[models.BankAccount], List[models.BankAccountTypedDict]] + Union[List[models.BankAccount1], List[models.BankAccount1TypedDict]] ] = None, websites: Optional[ Union[List[models.Website], List[models.WebsiteTypedDict]] @@ -809,7 +777,7 @@ async def create_async( consumer_id=consumer_id, app_id=app_id, service_id=service_id, - company=models.CompanyInput( + company1=models.Company1Input( name=name, owner_id=owner_id, image=image, @@ -830,7 +798,7 @@ async def create_async( first_name=first_name, last_name=last_name, bank_accounts=utils.get_pydantic_model( - bank_accounts, Optional[List[models.BankAccount]] + bank_accounts, Optional[List[models.BankAccount1]] ), websites=utils.get_pydantic_model( websites, Optional[List[models.Website]] @@ -879,7 +847,7 @@ async def create_async( ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.company, False, False, "json", models.CompanyInput + request.company1, False, False, "json", models.Company1Input ), timeout_ms=timeout_ms, ) @@ -914,62 +882,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.CrmCompaniesAddResponse( - create_company_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateCompanyResponse] + create_company_response=unmarshal_json_response( + Optional[models.CreateCompanyResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCompaniesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -1069,62 +1026,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCompaniesOneResponse( - get_company_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCompanyResponse] + get_company_response=unmarshal_json_response( + Optional[models.GetCompanyResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCompaniesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1224,62 +1170,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCompaniesOneResponse( - get_company_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCompanyResponse] + get_company_response=unmarshal_json_response( + Optional[models.GetCompanyResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCompaniesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1309,7 +1244,7 @@ def update( first_name: OptionalNullable[str] = UNSET, last_name: OptionalNullable[str] = UNSET, bank_accounts: Optional[ - Union[List[models.BankAccount], List[models.BankAccountTypedDict]] + Union[List[models.BankAccount1], List[models.BankAccount1TypedDict]] ] = None, websites: Optional[ Union[List[models.Website], List[models.WebsiteTypedDict]] @@ -1404,7 +1339,7 @@ def update( consumer_id=consumer_id, app_id=app_id, service_id=service_id, - company=models.CompanyInput( + company1=models.Company1Input( name=name, owner_id=owner_id, image=image, @@ -1425,7 +1360,7 @@ def update( first_name=first_name, last_name=last_name, bank_accounts=utils.get_pydantic_model( - bank_accounts, Optional[List[models.BankAccount]] + bank_accounts, Optional[List[models.BankAccount1]] ), websites=utils.get_pydantic_model( websites, Optional[List[models.Website]] @@ -1474,7 +1409,7 @@ def update( ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.company, False, False, "json", models.CompanyInput + request.company1, False, False, "json", models.Company1Input ), timeout_ms=timeout_ms, ) @@ -1509,62 +1444,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCompaniesUpdateResponse( - update_company_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateCompanyResponse] + update_company_response=unmarshal_json_response( + Optional[models.UpdateCompanyResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCompaniesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1594,7 +1518,7 @@ async def update_async( first_name: OptionalNullable[str] = UNSET, last_name: OptionalNullable[str] = UNSET, bank_accounts: Optional[ - Union[List[models.BankAccount], List[models.BankAccountTypedDict]] + Union[List[models.BankAccount1], List[models.BankAccount1TypedDict]] ] = None, websites: Optional[ Union[List[models.Website], List[models.WebsiteTypedDict]] @@ -1689,7 +1613,7 @@ async def update_async( consumer_id=consumer_id, app_id=app_id, service_id=service_id, - company=models.CompanyInput( + company1=models.Company1Input( name=name, owner_id=owner_id, image=image, @@ -1710,7 +1634,7 @@ async def update_async( first_name=first_name, last_name=last_name, bank_accounts=utils.get_pydantic_model( - bank_accounts, Optional[List[models.BankAccount]] + bank_accounts, Optional[List[models.BankAccount1]] ), websites=utils.get_pydantic_model( websites, Optional[List[models.Website]] @@ -1759,7 +1683,7 @@ async def update_async( ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.company, False, False, "json", models.CompanyInput + request.company1, False, False, "json", models.Company1Input ), timeout_ms=timeout_ms, ) @@ -1794,62 +1718,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCompaniesUpdateResponse( - update_company_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateCompanyResponse] + update_company_response=unmarshal_json_response( + Optional[models.UpdateCompanyResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCompaniesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1946,62 +1859,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCompaniesDeleteResponse( - delete_company_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteCompanyResponse] + delete_company_response=unmarshal_json_response( + Optional[models.DeleteCompanyResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCompaniesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -2098,59 +2000,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCompaniesDeleteResponse( - delete_company_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteCompanyResponse] + delete_company_response=unmarshal_json_response( + Optional[models.DeleteCompanyResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCompaniesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/companyinfo_sdk.py b/src/apideck_unify/companyinfo_sdk.py index c8a3a38d..c73c39f5 100644 --- a/src/apideck_unify/companyinfo_sdk.py +++ b/src/apideck_unify/companyinfo_sdk.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Mapping, Optional @@ -104,62 +105,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingCompanyInfoOneResponse( - get_company_info_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCompanyInfoResponse] + get_company_info_response=unmarshal_json_response( + Optional[models.GetCompanyInfoResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCompanyInfoOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -256,59 +246,48 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingCompanyInfoOneResponse( - get_company_info_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCompanyInfoResponse] + get_company_info_response=unmarshal_json_response( + Optional[models.GetCompanyInfoResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCompanyInfoOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/connectioncustommappings.py b/src/apideck_unify/connectioncustommappings.py index 63c79194..893ca53a 100644 --- a/src/apideck_unify/connectioncustommappings.py +++ b/src/apideck_unify/connectioncustommappings.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Mapping, Optional @@ -107,62 +108,51 @@ def list( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConnectionCustomMappingsAllResponse( - get_custom_mappings_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCustomMappingsResponse] + get_custom_mappings_response=unmarshal_json_response( + Optional[models.GetCustomMappingsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConnectionCustomMappingsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -262,59 +252,48 @@ async def list_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConnectionCustomMappingsAllResponse( - get_custom_mappings_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCustomMappingsResponse] + get_custom_mappings_response=unmarshal_json_response( + Optional[models.GetCustomMappingsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConnectionCustomMappingsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/connections.py b/src/apideck_unify/connections.py index 7ca10470..29974982 100644 --- a/src/apideck_unify/connections.py +++ b/src/apideck_unify/connections.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Dict, List, Mapping, Optional, Union @@ -104,62 +105,51 @@ def list( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConnectionsAllResponse( - get_connections_response=utils.unmarshal_json( - http_res.text, Optional[models.GetConnectionsResponse] + get_connections_response=unmarshal_json_response( + Optional[models.GetConnectionsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConnectionsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -256,62 +246,51 @@ async def list_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConnectionsAllResponse( - get_connections_response=utils.unmarshal_json( - http_res.text, Optional[models.GetConnectionsResponse] + get_connections_response=unmarshal_json_response( + Optional[models.GetConnectionsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConnectionsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -405,62 +384,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConnectionsOneResponse( - get_connection_response=utils.unmarshal_json( - http_res.text, Optional[models.GetConnectionResponse] + get_connection_response=unmarshal_json_response( + Optional[models.GetConnectionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConnectionsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -554,62 +522,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConnectionsOneResponse( - get_connection_response=utils.unmarshal_json( - http_res.text, Optional[models.GetConnectionResponse] + get_connection_response=unmarshal_json_response( + Optional[models.GetConnectionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConnectionsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -737,62 +694,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConnectionsUpdateResponse( - update_connection_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateConnectionResponse] + update_connection_response=unmarshal_json_response( + Optional[models.UpdateConnectionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConnectionsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -920,62 +866,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConnectionsUpdateResponse( - update_connection_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateConnectionResponse] + update_connection_response=unmarshal_json_response( + Optional[models.UpdateConnectionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConnectionsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1072,56 +1007,45 @@ def delete( http_meta=models.HTTPMetadata(request=req, response=http_res) ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConnectionsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1218,56 +1142,45 @@ async def delete_async( http_meta=models.HTTPMetadata(request=req, response=http_res) ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConnectionsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def imports( self, @@ -1384,62 +1297,51 @@ def imports( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConnectionsImportResponse( - create_connection_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateConnectionResponse] + create_connection_response=unmarshal_json_response( + Optional[models.CreateConnectionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConnectionsImportResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def imports_async( self, @@ -1556,62 +1458,51 @@ async def imports_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConnectionsImportResponse( - create_connection_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateConnectionResponse] + create_connection_response=unmarshal_json_response( + Optional[models.CreateConnectionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConnectionsImportResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def token( self, @@ -1728,62 +1619,51 @@ def token( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConnectionsTokenResponse( - get_connection_response=utils.unmarshal_json( - http_res.text, Optional[models.GetConnectionResponse] + get_connection_response=unmarshal_json_response( + Optional[models.GetConnectionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConnectionsTokenResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def token_async( self, @@ -1900,59 +1780,48 @@ async def token_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConnectionsTokenResponse( - get_connection_response=utils.unmarshal_json( - http_res.text, Optional[models.GetConnectionResponse] + get_connection_response=unmarshal_json_response( + Optional[models.GetConnectionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConnectionsTokenResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/connectionsettings.py b/src/apideck_unify/connectionsettings.py index 52ce0b7b..ba8439ab 100644 --- a/src/apideck_unify/connectionsettings.py +++ b/src/apideck_unify/connectionsettings.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Dict, List, Mapping, Optional, Union @@ -105,62 +106,51 @@ def list( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConnectionSettingsAllResponse( - get_connection_response=utils.unmarshal_json( - http_res.text, Optional[models.GetConnectionResponse] + get_connection_response=unmarshal_json_response( + Optional[models.GetConnectionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConnectionSettingsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -258,62 +248,51 @@ async def list_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConnectionSettingsAllResponse( - get_connection_response=utils.unmarshal_json( - http_res.text, Optional[models.GetConnectionResponse] + get_connection_response=unmarshal_json_response( + Optional[models.GetConnectionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConnectionSettingsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -444,62 +423,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConnectionSettingsUpdateResponse( - update_connection_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateConnectionResponse] + update_connection_response=unmarshal_json_response( + Optional[models.UpdateConnectionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConnectionSettingsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -630,59 +598,48 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConnectionSettingsUpdateResponse( - update_connection_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateConnectionResponse] + update_connection_response=unmarshal_json_response( + Optional[models.UpdateConnectionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConnectionSettingsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/connectordocs.py b/src/apideck_unify/connectordocs.py index 6b6b81d4..cd39fd87 100644 --- a/src/apideck_unify/connectordocs.py +++ b/src/apideck_unify/connectordocs.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from enum import Enum from typing import Any, Mapping, Optional @@ -111,46 +112,35 @@ def get( http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.ConnectorConnectorDocsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -248,43 +238,32 @@ async def get_async( http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.ConnectorConnectorDocsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/connectorresources.py b/src/apideck_unify/connectorresources.py index 9cec9f74..ff347285 100644 --- a/src/apideck_unify/connectorresources.py +++ b/src/apideck_unify/connectorresources.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Mapping, Optional @@ -100,52 +101,41 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.ConnectorConnectorResourcesOneResponse( - get_connector_resource_response=utils.unmarshal_json( - http_res.text, Optional[models.GetConnectorResourceResponse] + get_connector_resource_response=unmarshal_json_response( + Optional[models.GetConnectorResourceResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.ConnectorConnectorResourcesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -238,49 +228,38 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.ConnectorConnectorResourcesOneResponse( - get_connector_resource_response=utils.unmarshal_json( - http_res.text, Optional[models.GetConnectorResourceResponse] + get_connector_resource_response=unmarshal_json_response( + Optional[models.GetConnectorResourceResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.ConnectorConnectorResourcesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/connectors.py b/src/apideck_unify/connectors.py index 6dfaaaa1..83a0b222 100644 --- a/src/apideck_unify/connectors.py +++ b/src/apideck_unify/connectors.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -124,54 +125,43 @@ def next_func() -> Optional[models.ConnectorConnectorsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.ConnectorConnectorsAllResponse( - get_connectors_response=utils.unmarshal_json( - http_res.text, Optional[models.GetConnectorsResponse] + get_connectors_response=unmarshal_json_response( + Optional[models.GetConnectorsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.ConnectorConnectorsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -287,54 +277,43 @@ def next_func() -> Optional[models.ConnectorConnectorsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.ConnectorConnectorsAllResponse( - get_connectors_response=utils.unmarshal_json( - http_res.text, Optional[models.GetConnectorsResponse] + get_connectors_response=unmarshal_json_response( + Optional[models.GetConnectorsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.ConnectorConnectorsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -421,52 +400,41 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.ConnectorConnectorsOneResponse( - get_connector_response=utils.unmarshal_json( - http_res.text, Optional[models.GetConnectorResponse] + get_connector_response=unmarshal_json_response( + Optional[models.GetConnectorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.ConnectorConnectorsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -553,49 +521,38 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.ConnectorConnectorsOneResponse( - get_connector_response=utils.unmarshal_json( - http_res.text, Optional[models.GetConnectorResponse] + get_connector_response=unmarshal_json_response( + Optional[models.GetConnectorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.ConnectorConnectorsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/consumerrequestcounts.py b/src/apideck_unify/consumerrequestcounts.py index cb1914a6..5207d81f 100644 --- a/src/apideck_unify/consumerrequestcounts.py +++ b/src/apideck_unify/consumerrequestcounts.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Mapping, Optional @@ -101,63 +102,51 @@ def list( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConsumerRequestCountsAllResponse( - consumer_request_counts_in_date_range_response=utils.unmarshal_json( - http_res.text, - Optional[models.ConsumerRequestCountsInDateRangeResponse], + consumer_request_counts_in_date_range_response=unmarshal_json_response( + Optional[models.ConsumerRequestCountsInDateRangeResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConsumerRequestCountsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -251,60 +240,48 @@ async def list_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConsumerRequestCountsAllResponse( - consumer_request_counts_in_date_range_response=utils.unmarshal_json( - http_res.text, - Optional[models.ConsumerRequestCountsInDateRangeResponse], + consumer_request_counts_in_date_range_response=unmarshal_json_response( + Optional[models.ConsumerRequestCountsInDateRangeResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConsumerRequestCountsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/consumers.py b/src/apideck_unify/consumers.py index e7a6f90f..18454ded 100644 --- a/src/apideck_unify/consumers.py +++ b/src/apideck_unify/consumers.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -107,62 +108,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConsumersAddResponse( - create_consumer_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateConsumerResponse] + create_consumer_response=unmarshal_json_response( + Optional[models.CreateConsumerResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConsumersAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -261,62 +251,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConsumersAddResponse( - create_consumer_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateConsumerResponse] + create_consumer_response=unmarshal_json_response( + Optional[models.CreateConsumerResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConsumersAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def list( self, @@ -425,64 +404,53 @@ def next_func() -> Optional[models.VaultConsumersAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConsumersAllResponse( - get_consumers_response=utils.unmarshal_json( - http_res.text, Optional[models.GetConsumersResponse] + get_consumers_response=unmarshal_json_response( + Optional[models.GetConsumersResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConsumersAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -591,64 +559,53 @@ def next_func() -> Optional[models.VaultConsumersAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConsumersAllResponse( - get_consumers_response=utils.unmarshal_json( - http_res.text, Optional[models.GetConsumersResponse] + get_consumers_response=unmarshal_json_response( + Optional[models.GetConsumersResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConsumersAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -736,62 +693,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConsumersOneResponse( - get_consumer_response=utils.unmarshal_json( - http_res.text, Optional[models.GetConsumerResponse] + get_consumer_response=unmarshal_json_response( + Optional[models.GetConsumerResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConsumersOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -879,62 +825,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConsumersOneResponse( - get_consumer_response=utils.unmarshal_json( - http_res.text, Optional[models.GetConsumerResponse] + get_consumer_response=unmarshal_json_response( + Optional[models.GetConsumerResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConsumersOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1037,62 +972,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConsumersUpdateResponse( - update_consumer_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateConsumerResponse] + update_consumer_response=unmarshal_json_response( + Optional[models.UpdateConsumerResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConsumersUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1195,62 +1119,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConsumersUpdateResponse( - update_consumer_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateConsumerResponse] + update_consumer_response=unmarshal_json_response( + Optional[models.UpdateConsumerResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConsumersUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1337,62 +1250,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConsumersDeleteResponse( - delete_consumer_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteConsumerResponse] + delete_consumer_response=unmarshal_json_response( + Optional[models.DeleteConsumerResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConsumersDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1479,59 +1381,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultConsumersDeleteResponse( - delete_consumer_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteConsumerResponse] + delete_consumer_response=unmarshal_json_response( + Optional[models.DeleteConsumerResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultConsumersDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/contacts.py b/src/apideck_unify/contacts.py index 22eb0dad..f602ccec 100644 --- a/src/apideck_unify/contacts.py +++ b/src/apideck_unify/contacts.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -147,64 +148,53 @@ def next_func() -> Optional[models.CrmContactsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmContactsAllResponse( - get_contacts_response=utils.unmarshal_json( - http_res.text, Optional[models.GetContactsResponse] + get_contacts_response=unmarshal_json_response( + Optional[models.GetContactsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmContactsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -343,64 +333,53 @@ def next_func() -> Optional[models.CrmContactsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmContactsAllResponse( - get_contacts_response=utils.unmarshal_json( - http_res.text, Optional[models.GetContactsResponse] + get_contacts_response=unmarshal_json_response( + Optional[models.GetContactsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmContactsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -625,62 +604,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.CrmContactsAddResponse( - create_contact_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateContactResponse] + create_contact_response=unmarshal_json_response( + Optional[models.CreateContactResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmContactsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -905,62 +873,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.CrmContactsAddResponse( - create_contact_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateContactResponse] + create_contact_response=unmarshal_json_response( + Optional[models.CreateContactResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmContactsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -1065,62 +1022,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmContactsOneResponse( - get_contact_response=utils.unmarshal_json( - http_res.text, Optional[models.GetContactResponse] + get_contact_response=unmarshal_json_response( + Optional[models.GetContactResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmContactsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1225,62 +1171,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmContactsOneResponse( - get_contact_response=utils.unmarshal_json( - http_res.text, Optional[models.GetContactResponse] + get_contact_response=unmarshal_json_response( + Optional[models.GetContactResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmContactsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1508,62 +1443,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmContactsUpdateResponse( - update_contact_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateContactResponse] + update_contact_response=unmarshal_json_response( + Optional[models.UpdateContactResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmContactsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1791,62 +1715,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmContactsUpdateResponse( - update_contact_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateContactResponse] + update_contact_response=unmarshal_json_response( + Optional[models.UpdateContactResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmContactsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1943,62 +1856,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmContactsDeleteResponse( - delete_contact_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteContactResponse] + delete_contact_response=unmarshal_json_response( + Optional[models.DeleteContactResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmContactsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -2095,59 +1997,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmContactsDeleteResponse( - delete_contact_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteContactResponse] + delete_contact_response=unmarshal_json_response( + Optional[models.DeleteContactResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmContactsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/createcallback.py b/src/apideck_unify/createcallback.py index 2b06730b..d88a5d85 100644 --- a/src/apideck_unify/createcallback.py +++ b/src/apideck_unify/createcallback.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Mapping, Optional @@ -114,62 +115,51 @@ def state( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultCreateCallbackStateResponse( - create_callback_state_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateCallbackStateResponse] + create_callback_state_response=unmarshal_json_response( + Optional[models.CreateCallbackStateResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultCreateCallbackStateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def state_async( self, @@ -276,59 +266,48 @@ async def state_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultCreateCallbackStateResponse( - create_callback_state_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateCallbackStateResponse] + create_callback_state_response=unmarshal_json_response( + Optional[models.CreateCallbackStateResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultCreateCallbackStateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/creditnotes.py b/src/apideck_unify/creditnotes.py index 741b0098..7da8ac66 100644 --- a/src/apideck_unify/creditnotes.py +++ b/src/apideck_unify/creditnotes.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from datetime import datetime from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -152,64 +153,53 @@ def next_func() -> Optional[models.AccountingCreditNotesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingCreditNotesAllResponse( - get_credit_notes_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCreditNotesResponse] + get_credit_notes_response=unmarshal_json_response( + Optional[models.GetCreditNotesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCreditNotesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -352,64 +342,53 @@ def next_func() -> Optional[models.AccountingCreditNotesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingCreditNotesAllResponse( - get_credit_notes_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCreditNotesResponse] + get_credit_notes_response=unmarshal_json_response( + Optional[models.GetCreditNotesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCreditNotesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -638,62 +617,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingCreditNotesAddResponse( - create_credit_note_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateCreditNoteResponse] + create_credit_note_response=unmarshal_json_response( + Optional[models.CreateCreditNoteResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCreditNotesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -922,62 +890,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingCreditNotesAddResponse( - create_credit_note_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateCreditNoteResponse] + create_credit_note_response=unmarshal_json_response( + Optional[models.CreateCreditNoteResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCreditNotesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -1077,62 +1034,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingCreditNotesOneResponse( - get_credit_note_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCreditNoteResponse] + get_credit_note_response=unmarshal_json_response( + Optional[models.GetCreditNoteResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCreditNotesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1232,62 +1178,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingCreditNotesOneResponse( - get_credit_note_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCreditNoteResponse] + get_credit_note_response=unmarshal_json_response( + Optional[models.GetCreditNoteResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCreditNotesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1519,62 +1454,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingCreditNotesUpdateResponse( - update_credit_note_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateCreditNoteResponse] + update_credit_note_response=unmarshal_json_response( + Optional[models.UpdateCreditNoteResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCreditNotesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1806,62 +1730,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingCreditNotesUpdateResponse( - update_credit_note_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateCreditNoteResponse] + update_credit_note_response=unmarshal_json_response( + Optional[models.UpdateCreditNoteResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCreditNotesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1958,62 +1871,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingCreditNotesDeleteResponse( - delete_credit_note_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteCreditNoteResponse] + delete_credit_note_response=unmarshal_json_response( + Optional[models.DeleteCreditNoteResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCreditNotesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -2110,59 +2012,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingCreditNotesDeleteResponse( - delete_credit_note_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteCreditNoteResponse] + delete_credit_note_response=unmarshal_json_response( + Optional[models.DeleteCreditNoteResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCreditNotesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/customers.py b/src/apideck_unify/customers.py index 4e38eb0b..4a3fc69f 100644 --- a/src/apideck_unify/customers.py +++ b/src/apideck_unify/customers.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -149,64 +150,53 @@ def next_func() -> Optional[models.AccountingCustomersAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingCustomersAllResponse( - get_customers_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCustomersResponse] + get_customers_response=unmarshal_json_response( + Optional[models.GetCustomersResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCustomersAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -347,64 +337,53 @@ def next_func() -> Optional[models.AccountingCustomersAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingCustomersAllResponse( - get_customers_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCustomersResponse] + get_customers_response=unmarshal_json_response( + Optional[models.GetCustomersResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCustomersAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -626,62 +605,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingCustomersAddResponse( - create_customer_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateCustomerResponse] + create_customer_response=unmarshal_json_response( + Optional[models.CreateCustomerResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCustomersAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -903,62 +871,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingCustomersAddResponse( - create_customer_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateCustomerResponse] + create_customer_response=unmarshal_json_response( + Optional[models.CreateCustomerResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCustomersAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -1058,62 +1015,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingCustomersOneResponse( - get_customer_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCustomerResponse] + get_customer_response=unmarshal_json_response( + Optional[models.GetCustomerResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCustomersOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1213,62 +1159,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingCustomersOneResponse( - get_customer_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCustomerResponse] + get_customer_response=unmarshal_json_response( + Optional[models.GetCustomerResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCustomersOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1493,62 +1428,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingCustomersUpdateResponse( - update_customer_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateCustomerResponse] + update_customer_response=unmarshal_json_response( + Optional[models.UpdateCustomerResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCustomersUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1773,62 +1697,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingCustomersUpdateResponse( - update_customer_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateCustomerResponse] + update_customer_response=unmarshal_json_response( + Optional[models.UpdateCustomerResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCustomersUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1925,62 +1838,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingCustomersDeleteResponse( - delete_customer_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteCustomerResponse] + delete_customer_response=unmarshal_json_response( + Optional[models.DeleteCustomerResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCustomersDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -2077,59 +1979,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingCustomersDeleteResponse( - delete_customer_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteCustomerResponse] + delete_customer_response=unmarshal_json_response( + Optional[models.DeleteCustomerResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingCustomersDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/customfields.py b/src/apideck_unify/customfields.py index 9075938e..ebc0c4a0 100644 --- a/src/apideck_unify/customfields.py +++ b/src/apideck_unify/customfields.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Mapping, Optional @@ -108,62 +109,51 @@ def list( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultCustomFieldsAllResponse( - get_custom_fields_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCustomFieldsResponse] + get_custom_fields_response=unmarshal_json_response( + Optional[models.GetCustomFieldsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultCustomFieldsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -264,59 +254,48 @@ async def list_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultCustomFieldsAllResponse( - get_custom_fields_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCustomFieldsResponse] + get_custom_fields_response=unmarshal_json_response( + Optional[models.GetCustomFieldsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultCustomFieldsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/custommappings.py b/src/apideck_unify/custommappings.py index 52c9029a..838b7a45 100644 --- a/src/apideck_unify/custommappings.py +++ b/src/apideck_unify/custommappings.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Mapping, Optional @@ -101,62 +102,51 @@ def list( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultCustomMappingsAllResponse( - get_custom_mappings_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCustomMappingsResponse] + get_custom_mappings_response=unmarshal_json_response( + Optional[models.GetCustomMappingsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultCustomMappingsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -250,59 +240,48 @@ async def list_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultCustomMappingsAllResponse( - get_custom_mappings_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCustomMappingsResponse] + get_custom_mappings_response=unmarshal_json_response( + Optional[models.GetCustomMappingsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultCustomMappingsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/customobjects.py b/src/apideck_unify/customobjects.py index f0d522cc..2007e730 100644 --- a/src/apideck_unify/customobjects.py +++ b/src/apideck_unify/customobjects.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -141,64 +142,53 @@ def next_func() -> Optional[models.CrmCustomObjectsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCustomObjectsAllResponse( - get_custom_objects_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCustomObjectsResponse] + get_custom_objects_response=unmarshal_json_response( + Optional[models.GetCustomObjectsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCustomObjectsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -331,64 +321,53 @@ def next_func() -> Optional[models.CrmCustomObjectsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCustomObjectsAllResponse( - get_custom_objects_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCustomObjectsResponse] + get_custom_objects_response=unmarshal_json_response( + Optional[models.GetCustomObjectsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCustomObjectsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -510,62 +489,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.CrmCustomObjectsAddResponse( - create_custom_object_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateCustomObjectResponse] + create_custom_object_response=unmarshal_json_response( + Optional[models.CreateCustomObjectResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCustomObjectsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -687,62 +655,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.CrmCustomObjectsAddResponse( - create_custom_object_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateCustomObjectResponse] + create_custom_object_response=unmarshal_json_response( + Optional[models.CreateCustomObjectResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCustomObjectsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -842,62 +799,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCustomObjectsOneResponse( - get_custom_object_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCustomObjectResponse] + get_custom_object_response=unmarshal_json_response( + Optional[models.GetCustomObjectResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCustomObjectsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -997,62 +943,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCustomObjectsOneResponse( - get_custom_object_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCustomObjectResponse] + get_custom_object_response=unmarshal_json_response( + Optional[models.GetCustomObjectResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCustomObjectsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1177,62 +1112,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCustomObjectsUpdateResponse( - update_custom_object_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateCustomObjectResponse] + update_custom_object_response=unmarshal_json_response( + Optional[models.UpdateCustomObjectResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCustomObjectsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1357,62 +1281,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCustomObjectsUpdateResponse( - update_custom_object_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateCustomObjectResponse] + update_custom_object_response=unmarshal_json_response( + Optional[models.UpdateCustomObjectResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCustomObjectsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1512,62 +1425,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCustomObjectsDeleteResponse( - delete_custom_object_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteCustomObjectResponse] + delete_custom_object_response=unmarshal_json_response( + Optional[models.DeleteCustomObjectResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCustomObjectsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1667,59 +1569,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCustomObjectsDeleteResponse( - delete_custom_object_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteCustomObjectResponse] + delete_custom_object_response=unmarshal_json_response( + Optional[models.DeleteCustomObjectResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCustomObjectsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/customobjectschemas.py b/src/apideck_unify/customobjectschemas.py index 234e5a38..102b7343 100644 --- a/src/apideck_unify/customobjectschemas.py +++ b/src/apideck_unify/customobjectschemas.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -133,64 +134,53 @@ def next_func() -> Optional[models.CrmCustomObjectSchemasAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCustomObjectSchemasAllResponse( - get_custom_object_schemas_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCustomObjectSchemasResponse] + get_custom_object_schemas_response=unmarshal_json_response( + Optional[models.GetCustomObjectSchemasResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCustomObjectSchemasAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -315,64 +305,53 @@ def next_func() -> Optional[models.CrmCustomObjectSchemasAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCustomObjectSchemasAllResponse( - get_custom_object_schemas_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCustomObjectSchemasResponse] + get_custom_object_schemas_response=unmarshal_json_response( + Optional[models.GetCustomObjectSchemasResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCustomObjectSchemasAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -499,62 +478,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.CrmCustomObjectSchemasAddResponse( - create_custom_object_schema_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateCustomObjectSchemaResponse] + create_custom_object_schema_response=unmarshal_json_response( + Optional[models.CreateCustomObjectSchemaResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCustomObjectSchemasAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -681,62 +649,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.CrmCustomObjectSchemasAddResponse( - create_custom_object_schema_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateCustomObjectSchemaResponse] + create_custom_object_schema_response=unmarshal_json_response( + Optional[models.CreateCustomObjectSchemaResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCustomObjectSchemasAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -833,62 +790,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCustomObjectSchemasOneResponse( - get_custom_object_schema_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCustomObjectSchemaResponse] + get_custom_object_schema_response=unmarshal_json_response( + Optional[models.GetCustomObjectSchemaResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCustomObjectSchemasOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -985,62 +931,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCustomObjectSchemasOneResponse( - get_custom_object_schema_response=utils.unmarshal_json( - http_res.text, Optional[models.GetCustomObjectSchemaResponse] + get_custom_object_schema_response=unmarshal_json_response( + Optional[models.GetCustomObjectSchemaResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCustomObjectSchemasOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1170,62 +1105,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCustomObjectSchemasUpdateResponse( - update_custom_object_schema_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateCustomObjectSchemaResponse] + update_custom_object_schema_response=unmarshal_json_response( + Optional[models.UpdateCustomObjectSchemaResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCustomObjectSchemasUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1355,62 +1279,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCustomObjectSchemasUpdateResponse( - update_custom_object_schema_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateCustomObjectSchemaResponse] + update_custom_object_schema_response=unmarshal_json_response( + Optional[models.UpdateCustomObjectSchemaResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCustomObjectSchemasUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1507,62 +1420,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCustomObjectSchemasDeleteResponse( - delete_custom_object_schema_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteCustomObjectSchemaResponse] + delete_custom_object_schema_response=unmarshal_json_response( + Optional[models.DeleteCustomObjectSchemaResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCustomObjectSchemasDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1659,59 +1561,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmCustomObjectSchemasDeleteResponse( - delete_custom_object_schema_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteCustomObjectSchemaResponse] + delete_custom_object_schema_response=unmarshal_json_response( + Optional[models.DeleteCustomObjectSchemaResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmCustomObjectSchemasDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/departments.py b/src/apideck_unify/departments.py index 02daba55..3d674bc7 100644 --- a/src/apideck_unify/departments.py +++ b/src/apideck_unify/departments.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -144,64 +145,53 @@ def next_func() -> Optional[models.AccountingDepartmentsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingDepartmentsAllResponse( - get_accounting_departments_response=utils.unmarshal_json( - http_res.text, Optional[models.GetAccountingDepartmentsResponse] + get_accounting_departments_response=unmarshal_json_response( + Optional[models.GetAccountingDepartmentsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingDepartmentsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -337,64 +327,53 @@ def next_func() -> Optional[models.AccountingDepartmentsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingDepartmentsAllResponse( - get_accounting_departments_response=utils.unmarshal_json( - http_res.text, Optional[models.GetAccountingDepartmentsResponse] + get_accounting_departments_response=unmarshal_json_response( + Optional[models.GetAccountingDepartmentsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingDepartmentsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -529,62 +508,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingDepartmentsAddResponse( - create_accounting_department_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateAccountingDepartmentResponse] + create_accounting_department_response=unmarshal_json_response( + Optional[models.CreateAccountingDepartmentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingDepartmentsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -719,62 +687,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingDepartmentsAddResponse( - create_accounting_department_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateAccountingDepartmentResponse] + create_accounting_department_response=unmarshal_json_response( + Optional[models.CreateAccountingDepartmentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingDepartmentsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -874,62 +831,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingDepartmentsOneResponse( - get_accounting_department_response=utils.unmarshal_json( - http_res.text, Optional[models.GetAccountingDepartmentResponse] + get_accounting_department_response=unmarshal_json_response( + Optional[models.GetAccountingDepartmentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingDepartmentsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1029,62 +975,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingDepartmentsOneResponse( - get_accounting_department_response=utils.unmarshal_json( - http_res.text, Optional[models.GetAccountingDepartmentResponse] + get_accounting_department_response=unmarshal_json_response( + Optional[models.GetAccountingDepartmentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingDepartmentsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1222,62 +1157,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingDepartmentsUpdateResponse( - update_accounting_department_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateAccountingDepartmentResponse] + update_accounting_department_response=unmarshal_json_response( + Optional[models.UpdateAccountingDepartmentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingDepartmentsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1415,62 +1339,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingDepartmentsUpdateResponse( - update_accounting_department_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateAccountingDepartmentResponse] + update_accounting_department_response=unmarshal_json_response( + Optional[models.UpdateAccountingDepartmentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingDepartmentsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1567,62 +1480,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingDepartmentsDeleteResponse( - delete_accounting_department_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteAccountingDepartmentResponse] + delete_accounting_department_response=unmarshal_json_response( + Optional[models.DeleteAccountingDepartmentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingDepartmentsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1719,59 +1621,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingDepartmentsDeleteResponse( - delete_accounting_department_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteAccountingDepartmentResponse] + delete_accounting_department_response=unmarshal_json_response( + Optional[models.DeleteAccountingDepartmentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingDepartmentsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/drivegroups.py b/src/apideck_unify/drivegroups.py index 8d3157af..1bcf48be 100644 --- a/src/apideck_unify/drivegroups.py +++ b/src/apideck_unify/drivegroups.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -145,64 +146,53 @@ def next_func() -> Optional[models.FileStorageDriveGroupsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageDriveGroupsAllResponse( - get_drive_groups_response=utils.unmarshal_json( - http_res.text, Optional[models.GetDriveGroupsResponse] + get_drive_groups_response=unmarshal_json_response( + Optional[models.GetDriveGroupsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageDriveGroupsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -339,64 +329,53 @@ def next_func() -> Optional[models.FileStorageDriveGroupsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageDriveGroupsAllResponse( - get_drive_groups_response=utils.unmarshal_json( - http_res.text, Optional[models.GetDriveGroupsResponse] + get_drive_groups_response=unmarshal_json_response( + Optional[models.GetDriveGroupsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageDriveGroupsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -511,62 +490,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.FileStorageDriveGroupsAddResponse( - create_drive_group_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateDriveGroupResponse] + create_drive_group_response=unmarshal_json_response( + Optional[models.CreateDriveGroupResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageDriveGroupsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -681,62 +649,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.FileStorageDriveGroupsAddResponse( - create_drive_group_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateDriveGroupResponse] + create_drive_group_response=unmarshal_json_response( + Optional[models.CreateDriveGroupResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageDriveGroupsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -836,62 +793,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageDriveGroupsOneResponse( - get_drive_group_response=utils.unmarshal_json( - http_res.text, Optional[models.GetDriveGroupResponse] + get_drive_group_response=unmarshal_json_response( + Optional[models.GetDriveGroupResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageDriveGroupsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -991,62 +937,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageDriveGroupsOneResponse( - get_drive_group_response=utils.unmarshal_json( - http_res.text, Optional[models.GetDriveGroupResponse] + get_drive_group_response=unmarshal_json_response( + Optional[models.GetDriveGroupResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageDriveGroupsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1164,62 +1099,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageDriveGroupsUpdateResponse( - update_drive_group_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateDriveGroupResponse] + update_drive_group_response=unmarshal_json_response( + Optional[models.UpdateDriveGroupResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageDriveGroupsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1337,62 +1261,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageDriveGroupsUpdateResponse( - update_drive_group_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateDriveGroupResponse] + update_drive_group_response=unmarshal_json_response( + Optional[models.UpdateDriveGroupResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageDriveGroupsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1489,62 +1402,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageDriveGroupsDeleteResponse( - delete_drive_group_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteDriveGroupResponse] + delete_drive_group_response=unmarshal_json_response( + Optional[models.DeleteDriveGroupResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageDriveGroupsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1641,59 +1543,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageDriveGroupsDeleteResponse( - delete_drive_group_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteDriveGroupResponse] + delete_drive_group_response=unmarshal_json_response( + Optional[models.DeleteDriveGroupResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageDriveGroupsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/drives.py b/src/apideck_unify/drives.py index a13f0722..2c2012fe 100644 --- a/src/apideck_unify/drives.py +++ b/src/apideck_unify/drives.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -139,64 +140,53 @@ def next_func() -> Optional[models.FileStorageDrivesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageDrivesAllResponse( - get_drives_response=utils.unmarshal_json( - http_res.text, Optional[models.GetDrivesResponse] + get_drives_response=unmarshal_json_response( + Optional[models.GetDrivesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageDrivesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -327,64 +317,53 @@ def next_func() -> Optional[models.FileStorageDrivesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageDrivesAllResponse( - get_drives_response=utils.unmarshal_json( - http_res.text, Optional[models.GetDrivesResponse] + get_drives_response=unmarshal_json_response( + Optional[models.GetDrivesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageDrivesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -496,62 +475,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.FileStorageDrivesAddResponse( - create_drive_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateDriveResponse] + create_drive_response=unmarshal_json_response( + Optional[models.CreateDriveResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageDrivesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -663,62 +631,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.FileStorageDrivesAddResponse( - create_drive_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateDriveResponse] + create_drive_response=unmarshal_json_response( + Optional[models.CreateDriveResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageDrivesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -818,62 +775,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageDrivesOneResponse( - get_drive_response=utils.unmarshal_json( - http_res.text, Optional[models.GetDriveResponse] + get_drive_response=unmarshal_json_response( + Optional[models.GetDriveResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageDrivesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -973,62 +919,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageDrivesOneResponse( - get_drive_response=utils.unmarshal_json( - http_res.text, Optional[models.GetDriveResponse] + get_drive_response=unmarshal_json_response( + Optional[models.GetDriveResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageDrivesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1143,62 +1078,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageDrivesUpdateResponse( - update_drive_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateDriveResponse] + update_drive_response=unmarshal_json_response( + Optional[models.UpdateDriveResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageDrivesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1313,62 +1237,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageDrivesUpdateResponse( - update_drive_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateDriveResponse] + update_drive_response=unmarshal_json_response( + Optional[models.UpdateDriveResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageDrivesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1465,62 +1378,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageDrivesDeleteResponse( - delete_drive_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteDriveResponse] + delete_drive_response=unmarshal_json_response( + Optional[models.DeleteDriveResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageDrivesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1617,59 +1519,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageDrivesDeleteResponse( - delete_drive_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteDriveResponse] + delete_drive_response=unmarshal_json_response( + Optional[models.DeleteDriveResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageDrivesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/employeepayrolls.py b/src/apideck_unify/employeepayrolls.py index 1b9c3aa6..0ce561f3 100644 --- a/src/apideck_unify/employeepayrolls.py +++ b/src/apideck_unify/employeepayrolls.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Dict, Mapping, Optional, Union @@ -115,62 +116,51 @@ def list( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisEmployeePayrollsAllResponse( - get_employee_payrolls_response=utils.unmarshal_json( - http_res.text, Optional[models.GetEmployeePayrollsResponse] + get_employee_payrolls_response=unmarshal_json_response( + Optional[models.GetEmployeePayrollsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisEmployeePayrollsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -278,62 +268,51 @@ async def list_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisEmployeePayrollsAllResponse( - get_employee_payrolls_response=utils.unmarshal_json( - http_res.text, Optional[models.GetEmployeePayrollsResponse] + get_employee_payrolls_response=unmarshal_json_response( + Optional[models.GetEmployeePayrollsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisEmployeePayrollsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -436,62 +415,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisEmployeePayrollsOneResponse( - get_employee_payroll_response=utils.unmarshal_json( - http_res.text, Optional[models.GetEmployeePayrollResponse] + get_employee_payroll_response=unmarshal_json_response( + Optional[models.GetEmployeePayrollResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisEmployeePayrollsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -594,59 +562,48 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisEmployeePayrollsOneResponse( - get_employee_payroll_response=utils.unmarshal_json( - http_res.text, Optional[models.GetEmployeePayrollResponse] + get_employee_payroll_response=unmarshal_json_response( + Optional[models.GetEmployeePayrollResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisEmployeePayrollsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/employees.py b/src/apideck_unify/employees.py index 573c24c0..481e50d7 100644 --- a/src/apideck_unify/employees.py +++ b/src/apideck_unify/employees.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from datetime import date from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -150,64 +151,53 @@ def next_func() -> Optional[models.HrisEmployeesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisEmployeesAllResponse( - get_employees_response=utils.unmarshal_json( - http_res.text, Optional[models.GetEmployeesResponse] + get_employees_response=unmarshal_json_response( + Optional[models.GetEmployeesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisEmployeesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -348,64 +338,53 @@ def next_func() -> Optional[models.HrisEmployeesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisEmployeesAllResponse( - get_employees_response=utils.unmarshal_json( - http_res.text, Optional[models.GetEmployeesResponse] + get_employees_response=unmarshal_json_response( + Optional[models.GetEmployeesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisEmployeesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -733,62 +712,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.HrisEmployeesAddResponse( - create_employee_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateEmployeeResponse] + create_employee_response=unmarshal_json_response( + Optional[models.CreateEmployeeResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisEmployeesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -1116,62 +1084,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.HrisEmployeesAddResponse( - create_employee_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateEmployeeResponse] + create_employee_response=unmarshal_json_response( + Optional[models.CreateEmployeeResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisEmployeesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -1281,62 +1238,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisEmployeesOneResponse( - get_employee_response=utils.unmarshal_json( - http_res.text, Optional[models.GetEmployeeResponse] + get_employee_response=unmarshal_json_response( + Optional[models.GetEmployeeResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisEmployeesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1446,62 +1392,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisEmployeesOneResponse( - get_employee_response=utils.unmarshal_json( - http_res.text, Optional[models.GetEmployeeResponse] + get_employee_response=unmarshal_json_response( + Optional[models.GetEmployeeResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisEmployeesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1832,62 +1767,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisEmployeesUpdateResponse( - update_employee_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateEmployeeResponse] + update_employee_response=unmarshal_json_response( + Optional[models.UpdateEmployeeResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisEmployeesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -2218,62 +2142,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisEmployeesUpdateResponse( - update_employee_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateEmployeeResponse] + update_employee_response=unmarshal_json_response( + Optional[models.UpdateEmployeeResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisEmployeesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -2370,62 +2283,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisEmployeesDeleteResponse( - delete_employee_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteEmployeeResponse] + delete_employee_response=unmarshal_json_response( + Optional[models.DeleteEmployeeResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisEmployeesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -2522,59 +2424,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisEmployeesDeleteResponse( - delete_employee_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteEmployeeResponse] + delete_employee_response=unmarshal_json_response( + Optional[models.DeleteEmployeeResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisEmployeesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/employeeschedules_sdk.py b/src/apideck_unify/employeeschedules_sdk.py index 7e15a5c8..03a353cf 100644 --- a/src/apideck_unify/employeeschedules_sdk.py +++ b/src/apideck_unify/employeeschedules_sdk.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Dict, Mapping, Optional @@ -110,62 +111,51 @@ def list( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisEmployeeSchedulesAllResponse( - get_employee_schedules_response=utils.unmarshal_json( - http_res.text, Optional[models.GetEmployeeSchedulesResponse] + get_employee_schedules_response=unmarshal_json_response( + Optional[models.GetEmployeeSchedulesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisEmployeeSchedulesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -268,59 +258,48 @@ async def list_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisEmployeeSchedulesAllResponse( - get_employee_schedules_response=utils.unmarshal_json( - http_res.text, Optional[models.GetEmployeeSchedulesResponse] + get_employee_schedules_response=unmarshal_json_response( + Optional[models.GetEmployeeSchedulesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisEmployeeSchedulesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/eventlogs.py b/src/apideck_unify/eventlogs.py index f48ccb50..3be855ce 100644 --- a/src/apideck_unify/eventlogs.py +++ b/src/apideck_unify/eventlogs.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -124,64 +125,53 @@ def next_func() -> Optional[models.WebhookEventLogsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.WebhookEventLogsAllResponse( - get_webhook_event_logs_response=utils.unmarshal_json( - http_res.text, Optional[models.GetWebhookEventLogsResponse] + get_webhook_event_logs_response=unmarshal_json_response( + Optional[models.GetWebhookEventLogsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.WebhookEventLogsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -297,61 +287,50 @@ def next_func() -> Optional[models.WebhookEventLogsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.WebhookEventLogsAllResponse( - get_webhook_event_logs_response=utils.unmarshal_json( - http_res.text, Optional[models.GetWebhookEventLogsResponse] + get_webhook_event_logs_response=unmarshal_json_response( + Optional[models.GetWebhookEventLogsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.WebhookEventLogsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/expenses.py b/src/apideck_unify/expenses.py index 85074513..45488c6f 100644 --- a/src/apideck_unify/expenses.py +++ b/src/apideck_unify/expenses.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from datetime import datetime from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -130,64 +131,53 @@ def next_func() -> Optional[models.AccountingExpensesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingExpensesAllResponse( - get_expenses_response=utils.unmarshal_json( - http_res.text, Optional[models.GetExpensesResponse] + get_expenses_response=unmarshal_json_response( + Optional[models.GetExpensesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingExpensesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -308,64 +298,53 @@ def next_func() -> Optional[models.AccountingExpensesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingExpensesAllResponse( - get_expenses_response=utils.unmarshal_json( - http_res.text, Optional[models.GetExpensesResponse] + get_expenses_response=unmarshal_json_response( + Optional[models.GetExpensesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingExpensesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -538,62 +517,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingExpensesAddResponse( - create_expense_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateExpenseResponse] + create_expense_response=unmarshal_json_response( + Optional[models.CreateExpenseResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingExpensesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -766,62 +734,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingExpensesAddResponse( - create_expense_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateExpenseResponse] + create_expense_response=unmarshal_json_response( + Optional[models.CreateExpenseResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingExpensesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -918,62 +875,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingExpensesOneResponse( - get_expense_response=utils.unmarshal_json( - http_res.text, Optional[models.GetExpenseResponse] + get_expense_response=unmarshal_json_response( + Optional[models.GetExpenseResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingExpensesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1070,62 +1016,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingExpensesOneResponse( - get_expense_response=utils.unmarshal_json( - http_res.text, Optional[models.GetExpenseResponse] + get_expense_response=unmarshal_json_response( + Optional[models.GetExpenseResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingExpensesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1301,62 +1236,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingExpensesUpdateResponse( - update_expense_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateExpenseResponse] + update_expense_response=unmarshal_json_response( + Optional[models.UpdateExpenseResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingExpensesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1532,62 +1456,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingExpensesUpdateResponse( - update_expense_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateExpenseResponse] + update_expense_response=unmarshal_json_response( + Optional[models.UpdateExpenseResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingExpensesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1684,62 +1597,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingExpensesDeleteResponse( - delete_expense_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteExpenseResponse] + delete_expense_response=unmarshal_json_response( + Optional[models.DeleteExpenseResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingExpensesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1836,59 +1738,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingExpensesDeleteResponse( - delete_expense_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteExpenseResponse] + delete_expense_response=unmarshal_json_response( + Optional[models.DeleteExpenseResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingExpensesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/files.py b/src/apideck_unify/files.py index b601333a..6962e687 100644 --- a/src/apideck_unify/files.py +++ b/src/apideck_unify/files.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from enum import Enum from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -158,64 +159,53 @@ def next_func() -> Optional[models.FileStorageFilesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageFilesAllResponse( - get_files_response=utils.unmarshal_json( - http_res.text, Optional[models.GetFilesResponse] + get_files_response=unmarshal_json_response( + Optional[models.GetFilesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageFilesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -354,64 +344,53 @@ def next_func() -> Optional[models.FileStorageFilesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageFilesAllResponse( - get_files_response=utils.unmarshal_json( - http_res.text, Optional[models.GetFilesResponse] + get_files_response=unmarshal_json_response( + Optional[models.GetFilesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageFilesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def search( self, @@ -540,62 +519,51 @@ def search( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageFilesSearchResponse( - get_files_response=utils.unmarshal_json( - http_res.text, Optional[models.GetFilesResponse] + get_files_response=unmarshal_json_response( + Optional[models.GetFilesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageFilesSearchResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def search_async( self, @@ -724,62 +692,51 @@ async def search_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageFilesSearchResponse( - get_files_response=utils.unmarshal_json( - http_res.text, Optional[models.GetFilesResponse] + get_files_response=unmarshal_json_response( + Optional[models.GetFilesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageFilesSearchResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -879,62 +836,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageFilesOneResponse( - get_file_response=utils.unmarshal_json( - http_res.text, Optional[models.GetFileResponse] + get_file_response=unmarshal_json_response( + Optional[models.GetFileResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageFilesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1034,62 +980,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageFilesOneResponse( - get_file_response=utils.unmarshal_json( - http_res.text, Optional[models.GetFileResponse] + get_file_response=unmarshal_json_response( + Optional[models.GetFileResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageFilesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1211,62 +1146,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageFilesUpdateResponse( - update_file_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateFileResponse] + update_file_response=unmarshal_json_response( + Optional[models.UpdateFileResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageFilesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1388,62 +1312,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageFilesUpdateResponse( - update_file_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateFileResponse] + update_file_response=unmarshal_json_response( + Optional[models.UpdateFileResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageFilesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1540,62 +1453,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageFilesDeleteResponse( - delete_file_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteFileResponse] + delete_file_response=unmarshal_json_response( + Optional[models.DeleteFileResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageFilesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1692,62 +1594,51 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageFilesDeleteResponse( - delete_file_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteFileResponse] + delete_file_response=unmarshal_json_response( + Optional[models.DeleteFileResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageFilesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def download( self, @@ -1854,61 +1745,51 @@ def download( ) if utils.match_response(http_res, "400", "application/json"): http_res_text = utils.stream_to_text(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res, http_res_text ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "401", "application/json"): http_res_text = utils.stream_to_text(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res, http_res_text ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "402", "application/json"): http_res_text = utils.stream_to_text(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res, http_res_text ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "404", "application/json"): http_res_text = utils.stream_to_text(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res, http_res_text ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "422", "application/json"): http_res_text = utils.stream_to_text(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res, http_res_text ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): - http_response_text = utils.stream_to_text(http_res) + http_res_text = utils.stream_to_text(http_res) return models.FileStorageFilesDownloadResponse( - unexpected_error_response=utils.unmarshal_json( - http_response_text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res, http_res_text ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res, http_res_text) async def download_async( self, @@ -2015,61 +1896,51 @@ async def download_async( ) if utils.match_response(http_res, "400", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res, http_res_text ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "401", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res, http_res_text ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "402", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res, http_res_text ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "404", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res, http_res_text ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "422", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res, http_res_text ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): - http_response_text = await utils.stream_to_text_async(http_res) + http_res_text = await utils.stream_to_text_async(http_res) return models.FileStorageFilesDownloadResponse( - unexpected_error_response=utils.unmarshal_json( - http_response_text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res, http_res_text ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res, http_res_text) def export( self, @@ -2179,61 +2050,51 @@ def export( ) if utils.match_response(http_res, "400", "application/json"): http_res_text = utils.stream_to_text(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res, http_res_text ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "401", "application/json"): http_res_text = utils.stream_to_text(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res, http_res_text ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "402", "application/json"): http_res_text = utils.stream_to_text(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res, http_res_text ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "404", "application/json"): http_res_text = utils.stream_to_text(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res, http_res_text ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "422", "application/json"): http_res_text = utils.stream_to_text(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res, http_res_text ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): - http_response_text = utils.stream_to_text(http_res) + http_res_text = utils.stream_to_text(http_res) return models.FileStorageFilesExportResponse( - unexpected_error_response=utils.unmarshal_json( - http_response_text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res, http_res_text ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res, http_res_text) async def export_async( self, @@ -2343,58 +2204,48 @@ async def export_async( ) if utils.match_response(http_res, "400", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res, http_res_text ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "401", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res, http_res_text ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "402", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res, http_res_text ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "404", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res, http_res_text ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "422", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res, http_res_text ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res, http_res_text) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): - http_response_text = await utils.stream_to_text_async(http_res) + http_res_text = await utils.stream_to_text_async(http_res) return models.FileStorageFilesExportResponse( - unexpected_error_response=utils.unmarshal_json( - http_response_text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res, http_res_text ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res, http_res_text) diff --git a/src/apideck_unify/folders.py b/src/apideck_unify/folders.py index 247fa170..86b9498c 100644 --- a/src/apideck_unify/folders.py +++ b/src/apideck_unify/folders.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, List, Mapping, Optional, Union @@ -132,62 +133,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.FileStorageFoldersAddResponse( - create_folder_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateFolderResponse] + create_folder_response=unmarshal_json_response( + Optional[models.CreateFolderResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageFoldersAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -312,62 +302,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.FileStorageFoldersAddResponse( - create_folder_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateFolderResponse] + create_folder_response=unmarshal_json_response( + Optional[models.CreateFolderResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageFoldersAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -467,62 +446,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageFoldersOneResponse( - get_folder_response=utils.unmarshal_json( - http_res.text, Optional[models.GetFolderResponse] + get_folder_response=unmarshal_json_response( + Optional[models.GetFolderResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageFoldersOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -622,62 +590,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageFoldersOneResponse( - get_folder_response=utils.unmarshal_json( - http_res.text, Optional[models.GetFolderResponse] + get_folder_response=unmarshal_json_response( + Optional[models.GetFolderResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageFoldersOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -799,62 +756,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageFoldersUpdateResponse( - update_folder_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateFolderResponse] + update_folder_response=unmarshal_json_response( + Optional[models.UpdateFolderResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageFoldersUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -976,62 +922,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageFoldersUpdateResponse( - update_folder_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateFolderResponse] + update_folder_response=unmarshal_json_response( + Optional[models.UpdateFolderResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageFoldersUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1128,62 +1063,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageFoldersDeleteResponse( - delete_folder_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteFolderResponse] + delete_folder_response=unmarshal_json_response( + Optional[models.DeleteFolderResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageFoldersDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1280,62 +1204,51 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageFoldersDeleteResponse( - delete_folder_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteFolderResponse] + delete_folder_response=unmarshal_json_response( + Optional[models.DeleteFolderResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageFoldersDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def copy( self, @@ -1457,62 +1370,51 @@ def copy( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageFoldersCopyResponse( - update_folder_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateFolderResponse] + update_folder_response=unmarshal_json_response( + Optional[models.UpdateFolderResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageFoldersCopyResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def copy_async( self, @@ -1634,59 +1536,48 @@ async def copy_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageFoldersCopyResponse( - update_folder_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateFolderResponse] + update_folder_response=unmarshal_json_response( + Optional[models.UpdateFolderResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageFoldersCopyResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/invoiceitems.py b/src/apideck_unify/invoiceitems.py index 4fa8a53e..44e47995 100644 --- a/src/apideck_unify/invoiceitems.py +++ b/src/apideck_unify/invoiceitems.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from datetime import date from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -152,64 +153,53 @@ def next_func() -> Optional[models.AccountingInvoiceItemsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingInvoiceItemsAllResponse( - get_invoice_items_response=utils.unmarshal_json( - http_res.text, Optional[models.GetInvoiceItemsResponse] + get_invoice_items_response=unmarshal_json_response( + Optional[models.GetInvoiceItemsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingInvoiceItemsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -352,64 +342,53 @@ def next_func() -> Optional[models.AccountingInvoiceItemsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingInvoiceItemsAllResponse( - get_invoice_items_response=utils.unmarshal_json( - http_res.text, Optional[models.GetInvoiceItemsResponse] + get_invoice_items_response=unmarshal_json_response( + Optional[models.GetInvoiceItemsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingInvoiceItemsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -637,62 +616,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingInvoiceItemsAddResponse( - create_invoice_item_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateInvoiceItemResponse] + create_invoice_item_response=unmarshal_json_response( + Optional[models.CreateInvoiceItemResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingInvoiceItemsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -920,62 +888,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingInvoiceItemsAddResponse( - create_invoice_item_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateInvoiceItemResponse] + create_invoice_item_response=unmarshal_json_response( + Optional[models.CreateInvoiceItemResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingInvoiceItemsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -1082,62 +1039,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingInvoiceItemsOneResponse( - get_invoice_item_response=utils.unmarshal_json( - http_res.text, Optional[models.GetInvoiceItemResponse] + get_invoice_item_response=unmarshal_json_response( + Optional[models.GetInvoiceItemResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingInvoiceItemsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1244,62 +1190,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingInvoiceItemsOneResponse( - get_invoice_item_response=utils.unmarshal_json( - http_res.text, Optional[models.GetInvoiceItemResponse] + get_invoice_item_response=unmarshal_json_response( + Optional[models.GetInvoiceItemResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingInvoiceItemsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1530,62 +1465,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingInvoiceItemsUpdateResponse( - update_invoice_items_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateInvoiceItemsResponse] + update_invoice_items_response=unmarshal_json_response( + Optional[models.UpdateInvoiceItemsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingInvoiceItemsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1816,62 +1740,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingInvoiceItemsUpdateResponse( - update_invoice_items_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateInvoiceItemsResponse] + update_invoice_items_response=unmarshal_json_response( + Optional[models.UpdateInvoiceItemsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingInvoiceItemsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1968,62 +1881,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingInvoiceItemsDeleteResponse( - delete_tax_rate_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteTaxRateResponse] + delete_tax_rate_response=unmarshal_json_response( + Optional[models.DeleteTaxRateResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingInvoiceItemsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -2120,59 +2022,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingInvoiceItemsDeleteResponse( - delete_tax_rate_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteTaxRateResponse] + delete_tax_rate_response=unmarshal_json_response( + Optional[models.DeleteTaxRateResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingInvoiceItemsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/invoices.py b/src/apideck_unify/invoices.py index b821e78f..b0d0f70b 100644 --- a/src/apideck_unify/invoices.py +++ b/src/apideck_unify/invoices.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from datetime import date from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -148,64 +149,53 @@ def next_func() -> Optional[models.AccountingInvoicesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingInvoicesAllResponse( - get_invoices_response=utils.unmarshal_json( - http_res.text, Optional[models.GetInvoicesResponse] + get_invoices_response=unmarshal_json_response( + Optional[models.GetInvoicesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingInvoicesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -344,64 +334,53 @@ def next_func() -> Optional[models.AccountingInvoicesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingInvoicesAllResponse( - get_invoices_response=utils.unmarshal_json( - http_res.text, Optional[models.GetInvoicesResponse] + get_invoices_response=unmarshal_json_response( + Optional[models.GetInvoicesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingInvoicesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -682,62 +661,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingInvoicesAddResponse( - create_invoice_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateInvoiceResponse] + create_invoice_response=unmarshal_json_response( + Optional[models.CreateInvoiceResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingInvoicesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -1018,62 +986,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingInvoicesAddResponse( - create_invoice_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateInvoiceResponse] + create_invoice_response=unmarshal_json_response( + Optional[models.CreateInvoiceResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingInvoicesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -1173,62 +1130,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingInvoicesOneResponse( - get_invoice_response=utils.unmarshal_json( - http_res.text, Optional[models.GetInvoiceResponse] + get_invoice_response=unmarshal_json_response( + Optional[models.GetInvoiceResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingInvoicesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1328,62 +1274,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingInvoicesOneResponse( - get_invoice_response=utils.unmarshal_json( - http_res.text, Optional[models.GetInvoiceResponse] + get_invoice_response=unmarshal_json_response( + Optional[models.GetInvoiceResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingInvoicesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1667,62 +1602,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingInvoicesUpdateResponse( - update_invoice_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateInvoiceResponse] + update_invoice_response=unmarshal_json_response( + Optional[models.UpdateInvoiceResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingInvoicesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -2006,62 +1930,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingInvoicesUpdateResponse( - update_invoice_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateInvoiceResponse] + update_invoice_response=unmarshal_json_response( + Optional[models.UpdateInvoiceResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingInvoicesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -2158,62 +2071,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingInvoicesDeleteResponse( - delete_invoice_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteInvoiceResponse] + delete_invoice_response=unmarshal_json_response( + Optional[models.DeleteInvoiceResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingInvoicesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -2310,59 +2212,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingInvoicesDeleteResponse( - delete_invoice_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteInvoiceResponse] + delete_invoice_response=unmarshal_json_response( + Optional[models.DeleteInvoiceResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingInvoicesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/jobs.py b/src/apideck_unify/jobs.py index 10659e41..da673597 100644 --- a/src/apideck_unify/jobs.py +++ b/src/apideck_unify/jobs.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -137,64 +138,53 @@ def next_func() -> Optional[models.AtsJobsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AtsJobsAllResponse( - get_jobs_response=utils.unmarshal_json( - http_res.text, Optional[models.GetJobsResponse] + get_jobs_response=unmarshal_json_response( + Optional[models.GetJobsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsJobsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -323,64 +313,53 @@ def next_func() -> Optional[models.AtsJobsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AtsJobsAllResponse( - get_jobs_response=utils.unmarshal_json( - http_res.text, Optional[models.GetJobsResponse] + get_jobs_response=unmarshal_json_response( + Optional[models.GetJobsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsJobsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -480,62 +459,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AtsJobsOneResponse( - get_job_response=utils.unmarshal_json( - http_res.text, Optional[models.GetJobResponse] + get_job_response=unmarshal_json_response( + Optional[models.GetJobResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsJobsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -635,59 +603,48 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AtsJobsOneResponse( - get_job_response=utils.unmarshal_json( - http_res.text, Optional[models.GetJobResponse] + get_job_response=unmarshal_json_response( + Optional[models.GetJobResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AtsJobsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/journalentries.py b/src/apideck_unify/journalentries.py index 673bd992..f0ef089d 100644 --- a/src/apideck_unify/journalentries.py +++ b/src/apideck_unify/journalentries.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from datetime import datetime from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -152,64 +153,53 @@ def next_func() -> Optional[models.AccountingJournalEntriesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingJournalEntriesAllResponse( - get_journal_entries_response=utils.unmarshal_json( - http_res.text, Optional[models.GetJournalEntriesResponse] + get_journal_entries_response=unmarshal_json_response( + Optional[models.GetJournalEntriesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingJournalEntriesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -352,64 +342,53 @@ def next_func() -> Optional[models.AccountingJournalEntriesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingJournalEntriesAllResponse( - get_journal_entries_response=utils.unmarshal_json( - http_res.text, Optional[models.GetJournalEntriesResponse] + get_journal_entries_response=unmarshal_json_response( + Optional[models.GetJournalEntriesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingJournalEntriesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -582,62 +561,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingJournalEntriesAddResponse( - create_journal_entry_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateJournalEntryResponse] + create_journal_entry_response=unmarshal_json_response( + Optional[models.CreateJournalEntryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingJournalEntriesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -810,62 +778,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingJournalEntriesAddResponse( - create_journal_entry_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateJournalEntryResponse] + create_journal_entry_response=unmarshal_json_response( + Optional[models.CreateJournalEntryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingJournalEntriesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -965,62 +922,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingJournalEntriesOneResponse( - get_journal_entry_response=utils.unmarshal_json( - http_res.text, Optional[models.GetJournalEntryResponse] + get_journal_entry_response=unmarshal_json_response( + Optional[models.GetJournalEntryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingJournalEntriesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1120,62 +1066,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingJournalEntriesOneResponse( - get_journal_entry_response=utils.unmarshal_json( - http_res.text, Optional[models.GetJournalEntryResponse] + get_journal_entry_response=unmarshal_json_response( + Optional[models.GetJournalEntryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingJournalEntriesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1351,62 +1286,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingJournalEntriesUpdateResponse( - update_journal_entry_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateJournalEntryResponse] + update_journal_entry_response=unmarshal_json_response( + Optional[models.UpdateJournalEntryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingJournalEntriesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1582,62 +1506,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingJournalEntriesUpdateResponse( - update_journal_entry_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateJournalEntryResponse] + update_journal_entry_response=unmarshal_json_response( + Optional[models.UpdateJournalEntryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingJournalEntriesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1734,62 +1647,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingJournalEntriesDeleteResponse( - delete_journal_entry_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteJournalEntryResponse] + delete_journal_entry_response=unmarshal_json_response( + Optional[models.DeleteJournalEntryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingJournalEntriesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1886,59 +1788,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingJournalEntriesDeleteResponse( - delete_journal_entry_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteJournalEntryResponse] + delete_journal_entry_response=unmarshal_json_response( + Optional[models.DeleteJournalEntryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingJournalEntriesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/leads.py b/src/apideck_unify/leads.py index 3e097d1f..81df7938 100644 --- a/src/apideck_unify/leads.py +++ b/src/apideck_unify/leads.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -147,64 +148,53 @@ def next_func() -> Optional[models.CrmLeadsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmLeadsAllResponse( - get_leads_response=utils.unmarshal_json( - http_res.text, Optional[models.GetLeadsResponse] + get_leads_response=unmarshal_json_response( + Optional[models.GetLeadsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmLeadsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -343,64 +333,53 @@ def next_func() -> Optional[models.CrmLeadsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmLeadsAllResponse( - get_leads_response=utils.unmarshal_json( - http_res.text, Optional[models.GetLeadsResponse] + get_leads_response=unmarshal_json_response( + Optional[models.GetLeadsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmLeadsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -598,62 +577,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.CrmLeadsAddResponse( - create_lead_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateLeadResponse] + create_lead_response=unmarshal_json_response( + Optional[models.CreateLeadResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmLeadsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -851,62 +819,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.CrmLeadsAddResponse( - create_lead_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateLeadResponse] + create_lead_response=unmarshal_json_response( + Optional[models.CreateLeadResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmLeadsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -1006,62 +963,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmLeadsOneResponse( - get_lead_response=utils.unmarshal_json( - http_res.text, Optional[models.GetLeadResponse] + get_lead_response=unmarshal_json_response( + Optional[models.GetLeadResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmLeadsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1161,62 +1107,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmLeadsOneResponse( - get_lead_response=utils.unmarshal_json( - http_res.text, Optional[models.GetLeadResponse] + get_lead_response=unmarshal_json_response( + Optional[models.GetLeadResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmLeadsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1417,62 +1352,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmLeadsUpdateResponse( - update_lead_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateLeadResponse] + update_lead_response=unmarshal_json_response( + Optional[models.UpdateLeadResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmLeadsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1673,62 +1597,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmLeadsUpdateResponse( - update_lead_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateLeadResponse] + update_lead_response=unmarshal_json_response( + Optional[models.UpdateLeadResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmLeadsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1825,62 +1738,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmLeadsDeleteResponse( - delete_lead_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteLeadResponse] + delete_lead_response=unmarshal_json_response( + Optional[models.DeleteLeadResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmLeadsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1977,59 +1879,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmLeadsDeleteResponse( - delete_lead_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteLeadResponse] + delete_lead_response=unmarshal_json_response( + Optional[models.DeleteLeadResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmLeadsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/ledgeraccounts.py b/src/apideck_unify/ledgeraccounts.py index 73cf7c6c..b868e716 100644 --- a/src/apideck_unify/ledgeraccounts.py +++ b/src/apideck_unify/ledgeraccounts.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from datetime import date from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -152,64 +153,53 @@ def next_func() -> Optional[models.AccountingLedgerAccountsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingLedgerAccountsAllResponse( - get_ledger_accounts_response=utils.unmarshal_json( - http_res.text, Optional[models.GetLedgerAccountsResponse] + get_ledger_accounts_response=unmarshal_json_response( + Optional[models.GetLedgerAccountsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingLedgerAccountsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -352,64 +342,53 @@ def next_func() -> Optional[models.AccountingLedgerAccountsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingLedgerAccountsAllResponse( - get_ledger_accounts_response=utils.unmarshal_json( - http_res.text, Optional[models.GetLedgerAccountsResponse] + get_ledger_accounts_response=unmarshal_json_response( + Optional[models.GetLedgerAccountsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingLedgerAccountsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -613,62 +592,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingLedgerAccountsAddResponse( - create_ledger_account_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateLedgerAccountResponse] + create_ledger_account_response=unmarshal_json_response( + Optional[models.CreateLedgerAccountResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingLedgerAccountsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -872,62 +840,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingLedgerAccountsAddResponse( - create_ledger_account_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateLedgerAccountResponse] + create_ledger_account_response=unmarshal_json_response( + Optional[models.CreateLedgerAccountResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingLedgerAccountsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -1027,62 +984,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingLedgerAccountsOneResponse( - get_ledger_account_response=utils.unmarshal_json( - http_res.text, Optional[models.GetLedgerAccountResponse] + get_ledger_account_response=unmarshal_json_response( + Optional[models.GetLedgerAccountResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingLedgerAccountsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1182,62 +1128,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingLedgerAccountsOneResponse( - get_ledger_account_response=utils.unmarshal_json( - http_res.text, Optional[models.GetLedgerAccountResponse] + get_ledger_account_response=unmarshal_json_response( + Optional[models.GetLedgerAccountResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingLedgerAccountsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1444,62 +1379,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingLedgerAccountsUpdateResponse( - update_ledger_account_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateLedgerAccountResponse] + update_ledger_account_response=unmarshal_json_response( + Optional[models.UpdateLedgerAccountResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingLedgerAccountsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1706,62 +1630,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingLedgerAccountsUpdateResponse( - update_ledger_account_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateLedgerAccountResponse] + update_ledger_account_response=unmarshal_json_response( + Optional[models.UpdateLedgerAccountResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingLedgerAccountsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1858,62 +1771,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingLedgerAccountsDeleteResponse( - delete_ledger_account_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteLedgerAccountResponse] + delete_ledger_account_response=unmarshal_json_response( + Optional[models.DeleteLedgerAccountResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingLedgerAccountsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -2010,59 +1912,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingLedgerAccountsDeleteResponse( - delete_ledger_account_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteLedgerAccountResponse] + delete_ledger_account_response=unmarshal_json_response( + Optional[models.DeleteLedgerAccountResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingLedgerAccountsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/locations.py b/src/apideck_unify/locations.py index 02f7650b..12573d03 100644 --- a/src/apideck_unify/locations.py +++ b/src/apideck_unify/locations.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -144,64 +145,53 @@ def next_func() -> Optional[models.AccountingLocationsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingLocationsAllResponse( - get_accounting_locations_response=utils.unmarshal_json( - http_res.text, Optional[models.GetAccountingLocationsResponse] + get_accounting_locations_response=unmarshal_json_response( + Optional[models.GetAccountingLocationsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingLocationsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -337,64 +327,53 @@ def next_func() -> Optional[models.AccountingLocationsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingLocationsAllResponse( - get_accounting_locations_response=utils.unmarshal_json( - http_res.text, Optional[models.GetAccountingLocationsResponse] + get_accounting_locations_response=unmarshal_json_response( + Optional[models.GetAccountingLocationsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingLocationsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -536,62 +515,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingLocationsAddResponse( - create_accounting_location_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateAccountingLocationResponse] + create_accounting_location_response=unmarshal_json_response( + Optional[models.CreateAccountingLocationResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingLocationsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -733,62 +701,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingLocationsAddResponse( - create_accounting_location_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateAccountingLocationResponse] + create_accounting_location_response=unmarshal_json_response( + Optional[models.CreateAccountingLocationResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingLocationsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -888,62 +845,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingLocationsOneResponse( - get_accounting_location_response=utils.unmarshal_json( - http_res.text, Optional[models.GetAccountingLocationResponse] + get_accounting_location_response=unmarshal_json_response( + Optional[models.GetAccountingLocationResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingLocationsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1043,62 +989,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingLocationsOneResponse( - get_accounting_location_response=utils.unmarshal_json( - http_res.text, Optional[models.GetAccountingLocationResponse] + get_accounting_location_response=unmarshal_json_response( + Optional[models.GetAccountingLocationResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingLocationsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1243,62 +1178,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingLocationsUpdateResponse( - update_accounting_location_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateAccountingLocationResponse] + update_accounting_location_response=unmarshal_json_response( + Optional[models.UpdateAccountingLocationResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingLocationsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1443,62 +1367,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingLocationsUpdateResponse( - update_accounting_location_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateAccountingLocationResponse] + update_accounting_location_response=unmarshal_json_response( + Optional[models.UpdateAccountingLocationResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingLocationsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1595,62 +1508,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingLocationsDeleteResponse( - delete_accounting_location_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteAccountingLocationResponse] + delete_accounting_location_response=unmarshal_json_response( + Optional[models.DeleteAccountingLocationResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingLocationsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1747,59 +1649,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingLocationsDeleteResponse( - delete_accounting_location_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteAccountingLocationResponse] + delete_accounting_location_response=unmarshal_json_response( + Optional[models.DeleteAccountingLocationResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingLocationsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/logs.py b/src/apideck_unify/logs.py index e29e1399..9c53b886 100644 --- a/src/apideck_unify/logs.py +++ b/src/apideck_unify/logs.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -126,64 +127,53 @@ def next_func() -> Optional[models.VaultLogsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultLogsAllResponse( - get_logs_response=utils.unmarshal_json( - http_res.text, Optional[models.GetLogsResponse] + get_logs_response=unmarshal_json_response( + Optional[models.GetLogsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultLogsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -301,61 +291,50 @@ def next_func() -> Optional[models.VaultLogsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultLogsAllResponse( - get_logs_response=utils.unmarshal_json( - http_res.text, Optional[models.GetLogsResponse] + get_logs_response=unmarshal_json_response( + Optional[models.GetLogsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultLogsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/messages.py b/src/apideck_unify/messages.py index a759eb1a..485af069 100644 --- a/src/apideck_unify/messages.py +++ b/src/apideck_unify/messages.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from datetime import datetime from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -134,64 +135,53 @@ def next_func() -> Optional[models.SmsMessagesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SmsMessagesAllResponse( - get_messages_response=utils.unmarshal_json( - http_res.text, Optional[models.GetMessagesResponse] + get_messages_response=unmarshal_json_response( + Optional[models.GetMessagesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.SmsMessagesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -316,64 +306,53 @@ def next_func() -> Optional[models.SmsMessagesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SmsMessagesAllResponse( - get_messages_response=utils.unmarshal_json( - http_res.text, Optional[models.GetMessagesResponse] + get_messages_response=unmarshal_json_response( + Optional[models.GetMessagesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.SmsMessagesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -506,62 +485,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.SmsMessagesAddResponse( - create_message_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateMessageResponse] + create_message_response=unmarshal_json_response( + Optional[models.CreateMessageResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.SmsMessagesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -694,62 +662,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.SmsMessagesAddResponse( - create_message_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateMessageResponse] + create_message_response=unmarshal_json_response( + Optional[models.CreateMessageResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.SmsMessagesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -849,62 +806,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SmsMessagesOneResponse( - get_message_response=utils.unmarshal_json( - http_res.text, Optional[models.GetMessageResponse] + get_message_response=unmarshal_json_response( + Optional[models.GetMessageResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.SmsMessagesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1004,62 +950,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SmsMessagesOneResponse( - get_message_response=utils.unmarshal_json( - http_res.text, Optional[models.GetMessageResponse] + get_message_response=unmarshal_json_response( + Optional[models.GetMessageResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.SmsMessagesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1195,62 +1130,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SmsMessagesUpdateResponse( - update_message_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateMessageResponse] + update_message_response=unmarshal_json_response( + Optional[models.UpdateMessageResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.SmsMessagesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1386,62 +1310,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SmsMessagesUpdateResponse( - update_message_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateMessageResponse] + update_message_response=unmarshal_json_response( + Optional[models.UpdateMessageResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.SmsMessagesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1538,62 +1451,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SmsMessagesDeleteResponse( - delete_message_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteMessageResponse] + delete_message_response=unmarshal_json_response( + Optional[models.DeleteMessageResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.SmsMessagesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1690,59 +1592,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.SmsMessagesDeleteResponse( - delete_message_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteMessageResponse] + delete_message_response=unmarshal_json_response( + Optional[models.DeleteMessageResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.SmsMessagesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/models/__init__.py b/src/apideck_unify/models/__init__.py index 6eb46ac8..e3809b0a 100644 --- a/src/apideck_unify/models/__init__.py +++ b/src/apideck_unify/models/__init__.py @@ -916,6 +916,7 @@ AllocationTypedDict, ) from .api import API, APIType, APITypedDict, Resources, ResourcesTypedDict + from .apideckerror import ApideckError from .apierror import APIError from .apiresource import ( APIResource, @@ -1087,6 +1088,11 @@ PeriodType, ) from .bankaccount import AccountType, BankAccount, BankAccountTypedDict + from .bankaccount1 import ( + BankAccount1, + BankAccount1AccountType, + BankAccount1TypedDict, + ) from .bankfeedaccount import ( BankAccountType, BankFeedAccount, @@ -1149,13 +1155,13 @@ from .commentssort import CommentsSort, CommentsSortBy, CommentsSortTypedDict from .companiesfilter import CompaniesFilter, CompaniesFilterTypedDict from .companiessort import CompaniesSort, CompaniesSortBy, CompaniesSortTypedDict - from .company import ( - Company, - CompanyInput, - CompanyInputTypedDict, + from .company1 import ( + Company1, + Company1Input, + Company1InputTypedDict, + Company1TypedDict, CompanyRowType, CompanyRowTypeTypedDict, - CompanyTypedDict, ) from .companyinfo import ( CompanyInfo, @@ -3470,6 +3476,7 @@ PriceTypedDict, ) from .meta import Cursors, CursorsTypedDict, Meta, MetaTypedDict + from .no_response_error import NoResponseError from .note import Note, NoteTypedDict from .note_input import NoteInput, NoteInputTypedDict from .notfoundresponse import ( @@ -3579,6 +3586,7 @@ RequestCountAllocationTypedDict, ) from .resourcestatus import ResourceStatus + from .responsevalidationerror import ResponseValidationError from .schedule import ( EvenWeeks, EvenWeeksTypedDict, @@ -4896,6 +4904,7 @@ "Allocations", "AllocationsTypedDict", "AllowActions", + "ApideckError", "ApisFilter", "ApisFilterTypedDict", "Applicant", @@ -5015,6 +5024,9 @@ "BalanceSheetUncategorizedItemsAccount", "BalanceSheetUncategorizedItemsAccountTypedDict", "BankAccount", + "BankAccount1", + "BankAccount1AccountType", + "BankAccount1TypedDict", "BankAccountType", "BankAccountTypedDict", "BankFeedAccount", @@ -5084,15 +5096,15 @@ "CompaniesSort", "CompaniesSortBy", "CompaniesSortTypedDict", - "Company", + "Company1", + "Company1Input", + "Company1InputTypedDict", + "Company1TypedDict", "CompanyInfo", "CompanyInfoTypedDict", - "CompanyInput", - "CompanyInputTypedDict", "CompanyRowType", "CompanyRowTypeTypedDict", "CompanyStatus", - "CompanyTypedDict", "Compensation", "CompensationTypedDict", "Components", @@ -6795,6 +6807,7 @@ "Meta", "MetaTypedDict", "Mode", + "NoResponseError", "NotFoundResponse", "NotFoundResponseData", "NotFoundResponseDetail", @@ -6920,6 +6933,7 @@ "ResourceStatus", "Resources", "ResourcesTypedDict", + "ResponseValidationError", "Salary", "SalaryTypedDict", "SalesDetails", @@ -8090,6 +8104,7 @@ "APITypedDict": ".api", "Resources": ".api", "ResourcesTypedDict": ".api", + "ApideckError": ".apideckerror", "APIError": ".apierror", "APIResource": ".apiresource", "APIResourceTypedDict": ".apiresource", @@ -8230,6 +8245,9 @@ "AccountType": ".bankaccount", "BankAccount": ".bankaccount", "BankAccountTypedDict": ".bankaccount", + "BankAccount1": ".bankaccount1", + "BankAccount1AccountType": ".bankaccount1", + "BankAccount1TypedDict": ".bankaccount1", "BankAccountType": ".bankfeedaccount", "BankFeedAccount": ".bankfeedaccount", "BankFeedAccountInput": ".bankfeedaccount", @@ -8297,12 +8315,12 @@ "CompaniesSort": ".companiessort", "CompaniesSortBy": ".companiessort", "CompaniesSortTypedDict": ".companiessort", - "Company": ".company", - "CompanyInput": ".company", - "CompanyInputTypedDict": ".company", - "CompanyRowType": ".company", - "CompanyRowTypeTypedDict": ".company", - "CompanyTypedDict": ".company", + "Company1": ".company1", + "Company1Input": ".company1", + "Company1InputTypedDict": ".company1", + "Company1TypedDict": ".company1", + "CompanyRowType": ".company1", + "CompanyRowTypeTypedDict": ".company1", "CompanyInfo": ".companyinfo", "CompanyInfoTypedDict": ".companyinfo", "CompanyStatus": ".companyinfo", @@ -10035,6 +10053,7 @@ "CursorsTypedDict": ".meta", "Meta": ".meta", "MetaTypedDict": ".meta", + "NoResponseError": ".no_response_error", "Note": ".note", "NoteTypedDict": ".note", "NoteInput": ".note_input", @@ -10138,6 +10157,7 @@ "RequestCountAllocation": ".requestcountallocation", "RequestCountAllocationTypedDict": ".requestcountallocation", "ResourceStatus": ".resourcestatus", + "ResponseValidationError": ".responsevalidationerror", "EvenWeeks": ".schedule", "EvenWeeksTypedDict": ".schedule", "OddWeeks": ".schedule", diff --git a/src/apideck_unify/models/apideckerror.py b/src/apideck_unify/models/apideckerror.py new file mode 100644 index 00000000..81abbbbc --- /dev/null +++ b/src/apideck_unify/models/apideckerror.py @@ -0,0 +1,26 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import httpx +from typing import Optional + + +class ApideckError(Exception): + """The base class for all HTTP error responses.""" + + message: str + status_code: int + body: str + headers: httpx.Headers + raw_response: httpx.Response + + def __init__( + self, message: str, raw_response: httpx.Response, body: Optional[str] = None + ): + self.message = message + self.status_code = raw_response.status_code + self.body = body if body is not None else raw_response.text + self.headers = raw_response.headers + self.raw_response = raw_response + + def __str__(self): + return self.message diff --git a/src/apideck_unify/models/apierror.py b/src/apideck_unify/models/apierror.py index d4b6b02a..91d12df7 100644 --- a/src/apideck_unify/models/apierror.py +++ b/src/apideck_unify/models/apierror.py @@ -1,22 +1,38 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from dataclasses import dataclass -from typing import Optional import httpx +from typing import Optional + +from apideck_unify.models import ApideckError + +MAX_MESSAGE_LEN = 10_000 + + +class APIError(ApideckError): + """The fallback error class if no more specific error class is matched.""" + + def __init__( + self, message: str, raw_response: httpx.Response, body: Optional[str] = None + ): + body_display = body or raw_response.text or '""' + if message: + message += ": " + message += f"Status {raw_response.status_code}" -@dataclass -class APIError(Exception): - """Represents an error returned by the API.""" + headers = raw_response.headers + content_type = headers.get("content-type", '""') + if content_type != "application/json": + if " " in content_type: + content_type = f'"{content_type}"' + message += f" Content-Type {content_type}" - message: str - status_code: int = -1 - body: str = "" - raw_response: Optional[httpx.Response] = None + if len(body_display) > MAX_MESSAGE_LEN: + truncated = body_display[:MAX_MESSAGE_LEN] + remaining = len(body_display) - MAX_MESSAGE_LEN + body_display = f"{truncated}...and {remaining} more chars" - def __str__(self): - body = "" - if len(self.body) > 0: - body = f"\n{self.body}" + message += f". Body: {body_display}" + message = message.strip() - return f"{self.message}: Status {self.status_code}{body}" + super().__init__(message, raw_response, body) diff --git a/src/apideck_unify/models/badrequestresponse.py b/src/apideck_unify/models/badrequestresponse.py index 399983b7..0e1d28cb 100644 --- a/src/apideck_unify/models/badrequestresponse.py +++ b/src/apideck_unify/models/badrequestresponse.py @@ -1,7 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from apideck_unify.models import ApideckError from apideck_unify.types import BaseModel +import httpx from typing import Any, Dict, Optional, Union from typing_extensions import TypeAliasType @@ -38,13 +40,18 @@ class BadRequestResponseData(BaseModel): r"""Link to documentation of error type""" -class BadRequestResponse(Exception): +class BadRequestResponse(ApideckError): r"""Bad Request""" data: BadRequestResponseData - def __init__(self, data: BadRequestResponseData): + def __init__( + self, + data: BadRequestResponseData, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + fallback = body or raw_response.text + message = str(data.message) or fallback + super().__init__(message, raw_response, body) self.data = data - - def __str__(self) -> str: - return self.data.message if self.data.message is not None else "unknown error" diff --git a/src/apideck_unify/models/bankaccount.py b/src/apideck_unify/models/bankaccount.py index 6f245ee2..5ac6c822 100644 --- a/src/apideck_unify/models/bankaccount.py +++ b/src/apideck_unify/models/bankaccount.py @@ -45,6 +45,8 @@ class BankAccountTypedDict(TypedDict): r"""A bank code is a code assigned by a central bank, a bank supervisory body or a Bankers Association in a country to all its licensed member banks or financial institutions.""" currency: NotRequired[Nullable[Currency]] r"""Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217).""" + country: NotRequired[Nullable[str]] + r"""Country code according to ISO 3166-1 alpha-2.""" class BankAccount(BaseModel): @@ -81,6 +83,9 @@ class BankAccount(BaseModel): currency: OptionalNullable[Currency] = UNSET r"""Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217).""" + country: OptionalNullable[str] = UNSET + r"""Country code according to ISO 3166-1 alpha-2.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = [ @@ -95,6 +100,7 @@ def serialize_model(self, handler): "branch_identifier", "bank_code", "currency", + "country", ] nullable_fields = [ "bank_name", @@ -108,6 +114,7 @@ def serialize_model(self, handler): "branch_identifier", "bank_code", "currency", + "country", ] null_default_fields = [] diff --git a/src/apideck_unify/models/bankaccount1.py b/src/apideck_unify/models/bankaccount1.py new file mode 100644 index 00000000..b249f56f --- /dev/null +++ b/src/apideck_unify/models/bankaccount1.py @@ -0,0 +1,143 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .currency import Currency +from apideck_unify.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from enum import Enum +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class BankAccount1AccountType(str, Enum): + r"""The type of bank account.""" + + BANK_ACCOUNT = "bank_account" + CREDIT_CARD = "credit_card" + OTHER = "other" + + +class BankAccount1TypedDict(TypedDict): + bank_name: NotRequired[Nullable[str]] + r"""The name of the bank""" + account_number: NotRequired[Nullable[str]] + r"""A bank account number is a number that is tied to your bank account. If you have several bank accounts, such as personal, joint, business (and so on), each account will have a different account number.""" + account_name: NotRequired[Nullable[str]] + r"""The name which you used in opening your bank account.""" + account_type: NotRequired[Nullable[BankAccount1AccountType]] + r"""The type of bank account.""" + iban: NotRequired[Nullable[str]] + r"""The International Bank Account Number (IBAN).""" + bic: NotRequired[Nullable[str]] + r"""The Bank Identifier Code (BIC).""" + routing_number: NotRequired[Nullable[str]] + r"""A routing number is a nine-digit code used to identify a financial institution in the United States.""" + bsb_number: NotRequired[Nullable[str]] + r"""A BSB is a 6 digit numeric code used for identifying the branch of an Australian or New Zealand bank or financial institution.""" + branch_identifier: NotRequired[Nullable[str]] + r"""A branch identifier is a unique identifier for a branch of a bank or financial institution.""" + bank_code: NotRequired[Nullable[str]] + r"""A bank code is a code assigned by a central bank, a bank supervisory body or a Bankers Association in a country to all its licensed member banks or financial institutions.""" + currency: NotRequired[Nullable[Currency]] + r"""Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217).""" + country: NotRequired[Nullable[str]] + r"""Country code according to ISO 3166-1 alpha-2.""" + + +class BankAccount1(BaseModel): + bank_name: OptionalNullable[str] = UNSET + r"""The name of the bank""" + + account_number: OptionalNullable[str] = UNSET + r"""A bank account number is a number that is tied to your bank account. If you have several bank accounts, such as personal, joint, business (and so on), each account will have a different account number.""" + + account_name: OptionalNullable[str] = UNSET + r"""The name which you used in opening your bank account.""" + + account_type: OptionalNullable[BankAccount1AccountType] = UNSET + r"""The type of bank account.""" + + iban: OptionalNullable[str] = UNSET + r"""The International Bank Account Number (IBAN).""" + + bic: OptionalNullable[str] = UNSET + r"""The Bank Identifier Code (BIC).""" + + routing_number: OptionalNullable[str] = UNSET + r"""A routing number is a nine-digit code used to identify a financial institution in the United States.""" + + bsb_number: OptionalNullable[str] = UNSET + r"""A BSB is a 6 digit numeric code used for identifying the branch of an Australian or New Zealand bank or financial institution.""" + + branch_identifier: OptionalNullable[str] = UNSET + r"""A branch identifier is a unique identifier for a branch of a bank or financial institution.""" + + bank_code: OptionalNullable[str] = UNSET + r"""A bank code is a code assigned by a central bank, a bank supervisory body or a Bankers Association in a country to all its licensed member banks or financial institutions.""" + + currency: OptionalNullable[Currency] = UNSET + r"""Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217).""" + + country: OptionalNullable[str] = UNSET + r"""Country code according to ISO 3166-1 alpha-2.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "bank_name", + "account_number", + "account_name", + "account_type", + "iban", + "bic", + "routing_number", + "bsb_number", + "branch_identifier", + "bank_code", + "currency", + "country", + ] + nullable_fields = [ + "bank_name", + "account_number", + "account_name", + "account_type", + "iban", + "bic", + "routing_number", + "bsb_number", + "branch_identifier", + "bank_code", + "currency", + "country", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/apideck_unify/models/company.py b/src/apideck_unify/models/company1.py similarity index 98% rename from src/apideck_unify/models/company.py rename to src/apideck_unify/models/company1.py index ea0b5478..4f4c58ee 100644 --- a/src/apideck_unify/models/company.py +++ b/src/apideck_unify/models/company1.py @@ -2,7 +2,7 @@ from __future__ import annotations from .address import Address, AddressTypedDict -from .bankaccount import BankAccount, BankAccountTypedDict +from .bankaccount1 import BankAccount1, BankAccount1TypedDict from .currency import Currency from .customfield import CustomField, CustomFieldTypedDict from .email import Email, EmailTypedDict @@ -64,7 +64,7 @@ def serialize_model(self, handler): return m -class CompanyTypedDict(TypedDict): +class Company1TypedDict(TypedDict): name: Nullable[str] r"""Name of the company""" id: NotRequired[str] @@ -109,7 +109,7 @@ class CompanyTypedDict(TypedDict): r"""The last name of the person.""" parent_id: NotRequired[Nullable[str]] r"""Parent ID""" - bank_accounts: NotRequired[List[BankAccountTypedDict]] + bank_accounts: NotRequired[List[BankAccount1TypedDict]] websites: NotRequired[List[WebsiteTypedDict]] addresses: NotRequired[List[AddressTypedDict]] social_links: NotRequired[List[SocialLinkTypedDict]] @@ -142,7 +142,7 @@ class CompanyTypedDict(TypedDict): r"""The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources.""" -class Company(BaseModel): +class Company1(BaseModel): name: Nullable[str] r"""Name of the company""" @@ -209,7 +209,7 @@ class Company(BaseModel): parent_id: OptionalNullable[str] = UNSET r"""Parent ID""" - bank_accounts: Optional[List[BankAccount]] = None + bank_accounts: Optional[List[BankAccount1]] = None websites: Optional[List[Website]] = None @@ -365,7 +365,7 @@ def serialize_model(self, handler): return m -class CompanyInputTypedDict(TypedDict): +class Company1InputTypedDict(TypedDict): name: Nullable[str] r"""Name of the company""" owner_id: NotRequired[Nullable[str]] @@ -404,7 +404,7 @@ class CompanyInputTypedDict(TypedDict): r"""The first name of the person.""" last_name: NotRequired[Nullable[str]] r"""The last name of the person.""" - bank_accounts: NotRequired[List[BankAccountTypedDict]] + bank_accounts: NotRequired[List[BankAccount1TypedDict]] websites: NotRequired[List[WebsiteTypedDict]] addresses: NotRequired[List[AddressTypedDict]] social_links: NotRequired[List[SocialLinkTypedDict]] @@ -423,7 +423,7 @@ class CompanyInputTypedDict(TypedDict): r"""The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources.""" -class CompanyInput(BaseModel): +class Company1Input(BaseModel): name: Nullable[str] r"""Name of the company""" @@ -481,7 +481,7 @@ class CompanyInput(BaseModel): last_name: OptionalNullable[str] = UNSET r"""The last name of the person.""" - bank_accounts: Optional[List[BankAccount]] = None + bank_accounts: Optional[List[BankAccount1]] = None websites: Optional[List[Website]] = None diff --git a/src/apideck_unify/models/companyinfo.py b/src/apideck_unify/models/companyinfo.py index abfa761e..3992c966 100644 --- a/src/apideck_unify/models/companyinfo.py +++ b/src/apideck_unify/models/companyinfo.py @@ -74,6 +74,8 @@ class CompanyInfoTypedDict(TypedDict): emails: NotRequired[List[EmailTypedDict]] custom_mappings: NotRequired[Nullable[Dict[str, Any]]] r"""When custom mappings are configured on the resource, the result is included here.""" + tracking_categories_enabled: NotRequired[bool] + r"""Whether tracking categories are enabled for the company on transactions""" row_version: NotRequired[Nullable[str]] r"""A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object.""" updated_by: NotRequired[Nullable[str]] @@ -133,6 +135,9 @@ class CompanyInfo(BaseModel): custom_mappings: OptionalNullable[Dict[str, Any]] = UNSET r"""When custom mappings are configured on the resource, the result is included here.""" + tracking_categories_enabled: Optional[bool] = None + r"""Whether tracking categories are enabled for the company on transactions""" + row_version: OptionalNullable[str] = UNSET r"""A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object.""" @@ -168,6 +173,7 @@ def serialize_model(self, handler): "phone_numbers", "emails", "custom_mappings", + "tracking_categories_enabled", "row_version", "updated_by", "created_by", diff --git a/src/apideck_unify/models/crm_companiesaddop.py b/src/apideck_unify/models/crm_companiesaddop.py index e9ed3d96..40054845 100644 --- a/src/apideck_unify/models/crm_companiesaddop.py +++ b/src/apideck_unify/models/crm_companiesaddop.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .company import CompanyInput, CompanyInputTypedDict +from .company1 import Company1Input, Company1InputTypedDict from .createcompanyresponse import CreateCompanyResponse, CreateCompanyResponseTypedDict from .httpmetadata import HTTPMetadata, HTTPMetadataTypedDict from .unexpectederrorresponse import ( @@ -44,7 +44,7 @@ class CrmCompaniesAddGlobals(BaseModel): class CrmCompaniesAddRequestTypedDict(TypedDict): - company: CompanyInputTypedDict + company1: Company1InputTypedDict raw: NotRequired[bool] r"""Include raw response. Mostly used for debugging purposes""" consumer_id: NotRequired[str] @@ -56,8 +56,8 @@ class CrmCompaniesAddRequestTypedDict(TypedDict): class CrmCompaniesAddRequest(BaseModel): - company: Annotated[ - CompanyInput, + company1: Annotated[ + Company1Input, FieldMetadata(request=RequestMetadata(media_type="application/json")), ] diff --git a/src/apideck_unify/models/crm_companiesupdateop.py b/src/apideck_unify/models/crm_companiesupdateop.py index 086a0e1b..cb9dc160 100644 --- a/src/apideck_unify/models/crm_companiesupdateop.py +++ b/src/apideck_unify/models/crm_companiesupdateop.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .company import CompanyInput, CompanyInputTypedDict +from .company1 import Company1Input, Company1InputTypedDict from .httpmetadata import HTTPMetadata, HTTPMetadataTypedDict from .unexpectederrorresponse import ( UnexpectedErrorResponse, @@ -47,7 +47,7 @@ class CrmCompaniesUpdateGlobals(BaseModel): class CrmCompaniesUpdateRequestTypedDict(TypedDict): id: str r"""ID of the record you are acting upon.""" - company: CompanyInputTypedDict + company1: Company1InputTypedDict raw: NotRequired[bool] r"""Include raw response. Mostly used for debugging purposes""" consumer_id: NotRequired[str] @@ -64,8 +64,8 @@ class CrmCompaniesUpdateRequest(BaseModel): ] r"""ID of the record you are acting upon.""" - company: Annotated[ - CompanyInput, + company1: Annotated[ + Company1Input, FieldMetadata(request=RequestMetadata(media_type="application/json")), ] diff --git a/src/apideck_unify/models/getcompaniesresponse.py b/src/apideck_unify/models/getcompaniesresponse.py index 03878dac..5ae00cd3 100644 --- a/src/apideck_unify/models/getcompaniesresponse.py +++ b/src/apideck_unify/models/getcompaniesresponse.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .company import Company, CompanyTypedDict +from .company1 import Company1, Company1TypedDict from .links import Links, LinksTypedDict from .meta import Meta, MetaTypedDict from apideck_unify.types import ( @@ -30,7 +30,7 @@ class GetCompaniesResponseTypedDict(TypedDict): r"""Unified API resource name""" operation: str r"""Operation performed""" - data: List[CompanyTypedDict] + data: List[Company1TypedDict] meta: NotRequired[MetaTypedDict] r"""Response metadata""" links: NotRequired[LinksTypedDict] @@ -57,7 +57,7 @@ class GetCompaniesResponse(BaseModel): operation: str r"""Operation performed""" - data: List[Company] + data: List[Company1] meta: Optional[Meta] = None r"""Response metadata""" diff --git a/src/apideck_unify/models/getcompanyresponse.py b/src/apideck_unify/models/getcompanyresponse.py index b3d7a775..098db77a 100644 --- a/src/apideck_unify/models/getcompanyresponse.py +++ b/src/apideck_unify/models/getcompanyresponse.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .company import Company, CompanyTypedDict +from .company1 import Company1, Company1TypedDict from apideck_unify.types import ( BaseModel, Nullable, @@ -28,7 +28,7 @@ class GetCompanyResponseTypedDict(TypedDict): r"""Unified API resource name""" operation: str r"""Operation performed""" - data: CompanyTypedDict + data: Company1TypedDict raw: NotRequired[Nullable[Dict[str, Any]]] r"""Raw response from the integration when raw=true query param is provided""" @@ -51,7 +51,7 @@ class GetCompanyResponse(BaseModel): operation: str r"""Operation performed""" - data: Company + data: Company1 raw: Annotated[OptionalNullable[Dict[str, Any]], pydantic.Field(alias="_raw")] = ( UNSET diff --git a/src/apideck_unify/models/no_response_error.py b/src/apideck_unify/models/no_response_error.py new file mode 100644 index 00000000..f98beea2 --- /dev/null +++ b/src/apideck_unify/models/no_response_error.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +class NoResponseError(Exception): + """Error raised when no HTTP response is received from the server.""" + + message: str + + def __init__(self, message: str = "No response received"): + self.message = message + super().__init__(message) + + def __str__(self): + return self.message diff --git a/src/apideck_unify/models/notfoundresponse.py b/src/apideck_unify/models/notfoundresponse.py index 1b97adcb..28447ab7 100644 --- a/src/apideck_unify/models/notfoundresponse.py +++ b/src/apideck_unify/models/notfoundresponse.py @@ -1,7 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from apideck_unify.models import ApideckError from apideck_unify.types import BaseModel +import httpx from typing import Any, Dict, Optional, Union from typing_extensions import TypeAliasType @@ -38,13 +40,18 @@ class NotFoundResponseData(BaseModel): r"""Link to documentation of error type""" -class NotFoundResponse(Exception): +class NotFoundResponse(ApideckError): r"""The specified resource was not found""" data: NotFoundResponseData - def __init__(self, data: NotFoundResponseData): + def __init__( + self, + data: NotFoundResponseData, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + fallback = body or raw_response.text + message = str(data.message) or fallback + super().__init__(message, raw_response, body) self.data = data - - def __str__(self) -> str: - return self.data.message if self.data.message is not None else "unknown error" diff --git a/src/apideck_unify/models/paymentrequiredresponse.py b/src/apideck_unify/models/paymentrequiredresponse.py index fbbb929e..cc926ff2 100644 --- a/src/apideck_unify/models/paymentrequiredresponse.py +++ b/src/apideck_unify/models/paymentrequiredresponse.py @@ -1,7 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from apideck_unify.models import ApideckError from apideck_unify.types import BaseModel +import httpx from typing import Optional @@ -25,13 +27,18 @@ class PaymentRequiredResponseData(BaseModel): r"""Link to documentation of error type""" -class PaymentRequiredResponse(Exception): +class PaymentRequiredResponse(ApideckError): r"""Payment Required""" data: PaymentRequiredResponseData - def __init__(self, data: PaymentRequiredResponseData): + def __init__( + self, + data: PaymentRequiredResponseData, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + fallback = body or raw_response.text + message = str(data.message) or fallback + super().__init__(message, raw_response, body) self.data = data - - def __str__(self) -> str: - return self.data.message if self.data.message is not None else "unknown error" diff --git a/src/apideck_unify/models/responsevalidationerror.py b/src/apideck_unify/models/responsevalidationerror.py new file mode 100644 index 00000000..668dca44 --- /dev/null +++ b/src/apideck_unify/models/responsevalidationerror.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import httpx +from typing import Optional + +from apideck_unify.models import ApideckError + + +class ResponseValidationError(ApideckError): + """Error raised when there is a type mismatch between the response data and the expected Pydantic model.""" + + def __init__( + self, + message: str, + raw_response: httpx.Response, + cause: Exception, + body: Optional[str] = None, + ): + message = f"{message}: {cause}" + super().__init__(message, raw_response, body) + + @property + def cause(self): + """Normally the Pydantic ValidationError""" + return self.__cause__ diff --git a/src/apideck_unify/models/supplier.py b/src/apideck_unify/models/supplier.py index cdbf4251..54eacdd4 100644 --- a/src/apideck_unify/models/supplier.py +++ b/src/apideck_unify/models/supplier.py @@ -82,6 +82,8 @@ class SupplierTypedDict(TypedDict): r"""Supplier status""" payment_method: NotRequired[Nullable[str]] r"""Payment method used for the transaction, such as cash, credit card, bank transfer, or check""" + terms: NotRequired[Nullable[str]] + r"""Terms of payment.""" channel: NotRequired[Nullable[str]] r"""The channel through which the transaction is processed.""" custom_mappings: NotRequired[Nullable[Dict[str, Any]]] @@ -170,6 +172,9 @@ class Supplier(BaseModel): payment_method: OptionalNullable[str] = UNSET r"""Payment method used for the transaction, such as cash, credit card, bank transfer, or check""" + terms: OptionalNullable[str] = UNSET + r"""Terms of payment.""" + channel: OptionalNullable[str] = UNSET r"""The channel through which the transaction is processed.""" @@ -226,6 +231,7 @@ def serialize_model(self, handler): "account", "status", "payment_method", + "terms", "channel", "custom_mappings", "custom_fields", @@ -256,6 +262,7 @@ def serialize_model(self, handler): "account", "status", "payment_method", + "terms", "channel", "custom_mappings", "updated_by", @@ -329,6 +336,8 @@ class SupplierInputTypedDict(TypedDict): r"""Supplier status""" payment_method: NotRequired[Nullable[str]] r"""Payment method used for the transaction, such as cash, credit card, bank transfer, or check""" + terms: NotRequired[Nullable[str]] + r"""Terms of payment.""" channel: NotRequired[Nullable[str]] r"""The channel through which the transaction is processed.""" custom_fields: NotRequired[List[CustomFieldTypedDict]] @@ -401,6 +410,9 @@ class SupplierInput(BaseModel): payment_method: OptionalNullable[str] = UNSET r"""Payment method used for the transaction, such as cash, credit card, bank transfer, or check""" + terms: OptionalNullable[str] = UNSET + r"""Terms of payment.""" + channel: OptionalNullable[str] = UNSET r"""The channel through which the transaction is processed.""" @@ -441,6 +453,7 @@ def serialize_model(self, handler): "account", "status", "payment_method", + "terms", "channel", "custom_fields", "row_version", @@ -465,6 +478,7 @@ def serialize_model(self, handler): "account", "status", "payment_method", + "terms", "channel", "row_version", ] diff --git a/src/apideck_unify/models/unauthorizedresponse.py b/src/apideck_unify/models/unauthorizedresponse.py index 554b0304..44a7bc2e 100644 --- a/src/apideck_unify/models/unauthorizedresponse.py +++ b/src/apideck_unify/models/unauthorizedresponse.py @@ -1,7 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from apideck_unify.models import ApideckError from apideck_unify.types import BaseModel +import httpx from typing import Any, Dict, Optional, Union from typing_extensions import TypeAliasType @@ -38,13 +40,18 @@ class UnauthorizedResponseData(BaseModel): r"""Link to documentation of error type""" -class UnauthorizedResponse(Exception): +class UnauthorizedResponse(ApideckError): r"""Unauthorized""" data: UnauthorizedResponseData - def __init__(self, data: UnauthorizedResponseData): + def __init__( + self, + data: UnauthorizedResponseData, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + fallback = body or raw_response.text + message = str(data.message) or fallback + super().__init__(message, raw_response, body) self.data = data - - def __str__(self) -> str: - return self.data.message if self.data.message is not None else "unknown error" diff --git a/src/apideck_unify/models/unprocessableresponse.py b/src/apideck_unify/models/unprocessableresponse.py index 4dda36ce..b2e81ae5 100644 --- a/src/apideck_unify/models/unprocessableresponse.py +++ b/src/apideck_unify/models/unprocessableresponse.py @@ -1,7 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from apideck_unify.models import ApideckError from apideck_unify.types import BaseModel +import httpx from typing import Any, Dict, Optional, Union from typing_extensions import TypeAliasType @@ -38,13 +40,18 @@ class UnprocessableResponseData(BaseModel): r"""Link to documentation of error type""" -class UnprocessableResponse(Exception): +class UnprocessableResponse(ApideckError): r"""Unprocessable""" data: UnprocessableResponseData - def __init__(self, data: UnprocessableResponseData): + def __init__( + self, + data: UnprocessableResponseData, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + fallback = body or raw_response.text + message = str(data.message) or fallback + super().__init__(message, raw_response, body) self.data = data - - def __str__(self) -> str: - return self.data.message if self.data.message is not None else "unknown error" diff --git a/src/apideck_unify/notes.py b/src/apideck_unify/notes.py index acb87f47..f14bf075 100644 --- a/src/apideck_unify/notes.py +++ b/src/apideck_unify/notes.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -137,64 +138,53 @@ def next_func() -> Optional[models.CrmNotesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmNotesAllResponse( - get_notes_response=utils.unmarshal_json( - http_res.text, Optional[models.GetNotesResponse] + get_notes_response=unmarshal_json_response( + Optional[models.GetNotesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmNotesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -323,64 +313,53 @@ def next_func() -> Optional[models.CrmNotesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmNotesAllResponse( - get_notes_response=utils.unmarshal_json( - http_res.text, Optional[models.GetNotesResponse] + get_notes_response=unmarshal_json_response( + Optional[models.GetNotesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmNotesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -513,62 +492,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.CrmNotesAddResponse( - create_note_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateNoteResponse] + create_note_response=unmarshal_json_response( + Optional[models.CreateNoteResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmNotesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -701,62 +669,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.CrmNotesAddResponse( - create_note_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateNoteResponse] + create_note_response=unmarshal_json_response( + Optional[models.CreateNoteResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmNotesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -856,62 +813,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmNotesOneResponse( - get_note_response=utils.unmarshal_json( - http_res.text, Optional[models.GetNoteResponse] + get_note_response=unmarshal_json_response( + Optional[models.GetNoteResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmNotesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1011,62 +957,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmNotesOneResponse( - get_note_response=utils.unmarshal_json( - http_res.text, Optional[models.GetNoteResponse] + get_note_response=unmarshal_json_response( + Optional[models.GetNoteResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmNotesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1202,62 +1137,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmNotesUpdateResponse( - update_note_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateNoteResponse] + update_note_response=unmarshal_json_response( + Optional[models.UpdateNoteResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmNotesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1393,62 +1317,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmNotesUpdateResponse( - update_note_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateNoteResponse] + update_note_response=unmarshal_json_response( + Optional[models.UpdateNoteResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmNotesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1545,62 +1458,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmNotesDeleteResponse( - delete_note_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteNoteResponse] + delete_note_response=unmarshal_json_response( + Optional[models.DeleteNoteResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmNotesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1697,59 +1599,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmNotesDeleteResponse( - delete_note_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteNoteResponse] + delete_note_response=unmarshal_json_response( + Optional[models.DeleteNoteResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmNotesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/opportunities.py b/src/apideck_unify/opportunities.py index 3d03953d..334650fc 100644 --- a/src/apideck_unify/opportunities.py +++ b/src/apideck_unify/opportunities.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from datetime import date, datetime from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -152,64 +153,53 @@ def next_func() -> Optional[models.CrmOpportunitiesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmOpportunitiesAllResponse( - get_opportunities_response=utils.unmarshal_json( - http_res.text, Optional[models.GetOpportunitiesResponse] + get_opportunities_response=unmarshal_json_response( + Optional[models.GetOpportunitiesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmOpportunitiesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -352,64 +342,53 @@ def next_func() -> Optional[models.CrmOpportunitiesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmOpportunitiesAllResponse( - get_opportunities_response=utils.unmarshal_json( - http_res.text, Optional[models.GetOpportunitiesResponse] + get_opportunities_response=unmarshal_json_response( + Optional[models.GetOpportunitiesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmOpportunitiesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -603,62 +582,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.CrmOpportunitiesAddResponse( - create_opportunity_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateOpportunityResponse] + create_opportunity_response=unmarshal_json_response( + Optional[models.CreateOpportunityResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmOpportunitiesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -852,62 +820,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.CrmOpportunitiesAddResponse( - create_opportunity_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateOpportunityResponse] + create_opportunity_response=unmarshal_json_response( + Optional[models.CreateOpportunityResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmOpportunitiesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -1007,62 +964,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmOpportunitiesOneResponse( - get_opportunity_response=utils.unmarshal_json( - http_res.text, Optional[models.GetOpportunityResponse] + get_opportunity_response=unmarshal_json_response( + Optional[models.GetOpportunityResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmOpportunitiesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1162,62 +1108,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmOpportunitiesOneResponse( - get_opportunity_response=utils.unmarshal_json( - http_res.text, Optional[models.GetOpportunityResponse] + get_opportunity_response=unmarshal_json_response( + Optional[models.GetOpportunityResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmOpportunitiesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1414,62 +1349,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmOpportunitiesUpdateResponse( - update_opportunity_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateOpportunityResponse] + update_opportunity_response=unmarshal_json_response( + Optional[models.UpdateOpportunityResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmOpportunitiesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1666,62 +1590,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmOpportunitiesUpdateResponse( - update_opportunity_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateOpportunityResponse] + update_opportunity_response=unmarshal_json_response( + Optional[models.UpdateOpportunityResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmOpportunitiesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1818,62 +1731,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmOpportunitiesDeleteResponse( - delete_opportunity_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteOpportunityResponse] + delete_opportunity_response=unmarshal_json_response( + Optional[models.DeleteOpportunityResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmOpportunitiesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1970,59 +1872,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmOpportunitiesDeleteResponse( - delete_opportunity_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteOpportunityResponse] + delete_opportunity_response=unmarshal_json_response( + Optional[models.DeleteOpportunityResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmOpportunitiesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/orders.py b/src/apideck_unify/orders.py index e67e4bb4..d9045746 100644 --- a/src/apideck_unify/orders.py +++ b/src/apideck_unify/orders.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -149,64 +150,53 @@ def next_func() -> Optional[models.EcommerceOrdersAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.EcommerceOrdersAllResponse( - get_ecommerce_orders_response=utils.unmarshal_json( - http_res.text, Optional[models.GetEcommerceOrdersResponse] + get_ecommerce_orders_response=unmarshal_json_response( + Optional[models.GetEcommerceOrdersResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.EcommerceOrdersAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -347,64 +337,53 @@ def next_func() -> Optional[models.EcommerceOrdersAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.EcommerceOrdersAllResponse( - get_ecommerce_orders_response=utils.unmarshal_json( - http_res.text, Optional[models.GetEcommerceOrdersResponse] + get_ecommerce_orders_response=unmarshal_json_response( + Optional[models.GetEcommerceOrdersResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.EcommerceOrdersAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -504,62 +483,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.EcommerceOrdersOneResponse( - get_ecommerce_order_response=utils.unmarshal_json( - http_res.text, Optional[models.GetEcommerceOrderResponse] + get_ecommerce_order_response=unmarshal_json_response( + Optional[models.GetEcommerceOrderResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.EcommerceOrdersOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -659,59 +627,48 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.EcommerceOrdersOneResponse( - get_ecommerce_order_response=utils.unmarshal_json( - http_res.text, Optional[models.GetEcommerceOrderResponse] + get_ecommerce_order_response=unmarshal_json_response( + Optional[models.GetEcommerceOrderResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.EcommerceOrdersOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/payments.py b/src/apideck_unify/payments.py index 4ac5acb0..66800b2a 100644 --- a/src/apideck_unify/payments.py +++ b/src/apideck_unify/payments.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from datetime import datetime from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -148,64 +149,53 @@ def next_func() -> Optional[models.AccountingPaymentsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingPaymentsAllResponse( - get_payments_response=utils.unmarshal_json( - http_res.text, Optional[models.GetPaymentsResponse] + get_payments_response=unmarshal_json_response( + Optional[models.GetPaymentsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingPaymentsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -344,64 +334,53 @@ def next_func() -> Optional[models.AccountingPaymentsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingPaymentsAllResponse( - get_payments_response=utils.unmarshal_json( - http_res.text, Optional[models.GetPaymentsResponse] + get_payments_response=unmarshal_json_response( + Optional[models.GetPaymentsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingPaymentsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -613,62 +592,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingPaymentsAddResponse( - create_payment_response=utils.unmarshal_json( - http_res.text, Optional[models.CreatePaymentResponse] + create_payment_response=unmarshal_json_response( + Optional[models.CreatePaymentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingPaymentsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -880,62 +848,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingPaymentsAddResponse( - create_payment_response=utils.unmarshal_json( - http_res.text, Optional[models.CreatePaymentResponse] + create_payment_response=unmarshal_json_response( + Optional[models.CreatePaymentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingPaymentsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -1035,62 +992,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingPaymentsOneResponse( - get_payment_response=utils.unmarshal_json( - http_res.text, Optional[models.GetPaymentResponse] + get_payment_response=unmarshal_json_response( + Optional[models.GetPaymentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingPaymentsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1190,62 +1136,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingPaymentsOneResponse( - get_payment_response=utils.unmarshal_json( - http_res.text, Optional[models.GetPaymentResponse] + get_payment_response=unmarshal_json_response( + Optional[models.GetPaymentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingPaymentsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1460,62 +1395,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingPaymentsUpdateResponse( - update_payment_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdatePaymentResponse] + update_payment_response=unmarshal_json_response( + Optional[models.UpdatePaymentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingPaymentsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1730,62 +1654,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingPaymentsUpdateResponse( - update_payment_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdatePaymentResponse] + update_payment_response=unmarshal_json_response( + Optional[models.UpdatePaymentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingPaymentsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1882,62 +1795,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingPaymentsDeleteResponse( - delete_payment_response=utils.unmarshal_json( - http_res.text, Optional[models.DeletePaymentResponse] + delete_payment_response=unmarshal_json_response( + Optional[models.DeletePaymentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingPaymentsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -2034,59 +1936,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingPaymentsDeleteResponse( - delete_payment_response=utils.unmarshal_json( - http_res.text, Optional[models.DeletePaymentResponse] + delete_payment_response=unmarshal_json_response( + Optional[models.DeletePaymentResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingPaymentsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/payrolls.py b/src/apideck_unify/payrolls.py index 3e342094..9a2c6ac1 100644 --- a/src/apideck_unify/payrolls.py +++ b/src/apideck_unify/payrolls.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Dict, Mapping, Optional, Union @@ -112,62 +113,51 @@ def list( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisPayrollsAllResponse( - get_payrolls_response=utils.unmarshal_json( - http_res.text, Optional[models.GetPayrollsResponse] + get_payrolls_response=unmarshal_json_response( + Optional[models.GetPayrollsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisPayrollsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -272,62 +262,51 @@ async def list_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisPayrollsAllResponse( - get_payrolls_response=utils.unmarshal_json( - http_res.text, Optional[models.GetPayrollsResponse] + get_payrolls_response=unmarshal_json_response( + Optional[models.GetPayrollsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisPayrollsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -427,62 +406,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisPayrollsOneResponse( - get_payroll_response=utils.unmarshal_json( - http_res.text, Optional[models.GetPayrollResponse] + get_payroll_response=unmarshal_json_response( + Optional[models.GetPayrollResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisPayrollsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -582,59 +550,48 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisPayrollsOneResponse( - get_payroll_response=utils.unmarshal_json( - http_res.text, Optional[models.GetPayrollResponse] + get_payroll_response=unmarshal_json_response( + Optional[models.GetPayrollResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisPayrollsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/pipelines.py b/src/apideck_unify/pipelines.py index e74ca943..412aaba2 100644 --- a/src/apideck_unify/pipelines.py +++ b/src/apideck_unify/pipelines.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -137,64 +138,53 @@ def next_func() -> Optional[models.CrmPipelinesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmPipelinesAllResponse( - get_pipelines_response=utils.unmarshal_json( - http_res.text, Optional[models.GetPipelinesResponse] + get_pipelines_response=unmarshal_json_response( + Optional[models.GetPipelinesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmPipelinesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -323,64 +313,53 @@ def next_func() -> Optional[models.CrmPipelinesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmPipelinesAllResponse( - get_pipelines_response=utils.unmarshal_json( - http_res.text, Optional[models.GetPipelinesResponse] + get_pipelines_response=unmarshal_json_response( + Optional[models.GetPipelinesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmPipelinesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -514,62 +493,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.CrmPipelinesAddResponse( - create_pipeline_response=utils.unmarshal_json( - http_res.text, Optional[models.CreatePipelineResponse] + create_pipeline_response=unmarshal_json_response( + Optional[models.CreatePipelineResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmPipelinesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -703,62 +671,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.CrmPipelinesAddResponse( - create_pipeline_response=utils.unmarshal_json( - http_res.text, Optional[models.CreatePipelineResponse] + create_pipeline_response=unmarshal_json_response( + Optional[models.CreatePipelineResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmPipelinesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -858,62 +815,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmPipelinesOneResponse( - get_pipeline_response=utils.unmarshal_json( - http_res.text, Optional[models.GetPipelineResponse] + get_pipeline_response=unmarshal_json_response( + Optional[models.GetPipelineResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmPipelinesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1013,62 +959,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmPipelinesOneResponse( - get_pipeline_response=utils.unmarshal_json( - http_res.text, Optional[models.GetPipelineResponse] + get_pipeline_response=unmarshal_json_response( + Optional[models.GetPipelineResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmPipelinesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1205,62 +1140,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmPipelinesUpdateResponse( - update_pipeline_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdatePipelineResponse] + update_pipeline_response=unmarshal_json_response( + Optional[models.UpdatePipelineResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmPipelinesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1397,62 +1321,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmPipelinesUpdateResponse( - update_pipeline_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdatePipelineResponse] + update_pipeline_response=unmarshal_json_response( + Optional[models.UpdatePipelineResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmPipelinesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1549,62 +1462,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmPipelinesDeleteResponse( - delete_pipeline_response=utils.unmarshal_json( - http_res.text, Optional[models.DeletePipelineResponse] + delete_pipeline_response=unmarshal_json_response( + Optional[models.DeletePipelineResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmPipelinesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1701,59 +1603,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmPipelinesDeleteResponse( - delete_pipeline_response=utils.unmarshal_json( - http_res.text, Optional[models.DeletePipelineResponse] + delete_pipeline_response=unmarshal_json_response( + Optional[models.DeletePipelineResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmPipelinesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/products.py b/src/apideck_unify/products.py index 454ad177..d76b70f8 100644 --- a/src/apideck_unify/products.py +++ b/src/apideck_unify/products.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -137,64 +138,53 @@ def next_func() -> Optional[models.EcommerceProductsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.EcommerceProductsAllResponse( - get_products_response=utils.unmarshal_json( - http_res.text, Optional[models.GetProductsResponse] + get_products_response=unmarshal_json_response( + Optional[models.GetProductsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.EcommerceProductsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -323,64 +313,53 @@ def next_func() -> Optional[models.EcommerceProductsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.EcommerceProductsAllResponse( - get_products_response=utils.unmarshal_json( - http_res.text, Optional[models.GetProductsResponse] + get_products_response=unmarshal_json_response( + Optional[models.GetProductsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.EcommerceProductsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -480,62 +459,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.EcommerceProductsOneResponse( - get_product_response=utils.unmarshal_json( - http_res.text, Optional[models.GetProductResponse] + get_product_response=unmarshal_json_response( + Optional[models.GetProductResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.EcommerceProductsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -635,59 +603,48 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.EcommerceProductsOneResponse( - get_product_response=utils.unmarshal_json( - http_res.text, Optional[models.GetProductResponse] + get_product_response=unmarshal_json_response( + Optional[models.GetProductResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.EcommerceProductsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/profitandloss_sdk.py b/src/apideck_unify/profitandloss_sdk.py index ff683fcb..549344ff 100644 --- a/src/apideck_unify/profitandloss_sdk.py +++ b/src/apideck_unify/profitandloss_sdk.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Dict, Mapping, Optional, Union @@ -114,62 +115,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingProfitAndLossOneResponse( - get_profit_and_loss_response=utils.unmarshal_json( - http_res.text, Optional[models.GetProfitAndLossResponse] + get_profit_and_loss_response=unmarshal_json_response( + Optional[models.GetProfitAndLossResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingProfitAndLossOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -276,59 +266,48 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingProfitAndLossOneResponse( - get_profit_and_loss_response=utils.unmarshal_json( - http_res.text, Optional[models.GetProfitAndLossResponse] + get_profit_and_loss_response=unmarshal_json_response( + Optional[models.GetProfitAndLossResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingProfitAndLossOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/purchaseorders.py b/src/apideck_unify/purchaseorders.py index d5020261..b46de14d 100644 --- a/src/apideck_unify/purchaseorders.py +++ b/src/apideck_unify/purchaseorders.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from datetime import date from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -148,64 +149,53 @@ def next_func() -> Optional[models.AccountingPurchaseOrdersAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingPurchaseOrdersAllResponse( - get_purchase_orders_response=utils.unmarshal_json( - http_res.text, Optional[models.GetPurchaseOrdersResponse] + get_purchase_orders_response=unmarshal_json_response( + Optional[models.GetPurchaseOrdersResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingPurchaseOrdersAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -344,64 +334,53 @@ def next_func() -> Optional[models.AccountingPurchaseOrdersAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingPurchaseOrdersAllResponse( - get_purchase_orders_response=utils.unmarshal_json( - http_res.text, Optional[models.GetPurchaseOrdersResponse] + get_purchase_orders_response=unmarshal_json_response( + Optional[models.GetPurchaseOrdersResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingPurchaseOrdersAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -635,62 +614,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingPurchaseOrdersAddResponse( - create_purchase_order_response=utils.unmarshal_json( - http_res.text, Optional[models.CreatePurchaseOrderResponse] + create_purchase_order_response=unmarshal_json_response( + Optional[models.CreatePurchaseOrderResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingPurchaseOrdersAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -924,62 +892,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingPurchaseOrdersAddResponse( - create_purchase_order_response=utils.unmarshal_json( - http_res.text, Optional[models.CreatePurchaseOrderResponse] + create_purchase_order_response=unmarshal_json_response( + Optional[models.CreatePurchaseOrderResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingPurchaseOrdersAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -1076,62 +1033,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingPurchaseOrdersOneResponse( - get_purchase_order_response=utils.unmarshal_json( - http_res.text, Optional[models.GetPurchaseOrderResponse] + get_purchase_order_response=unmarshal_json_response( + Optional[models.GetPurchaseOrderResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingPurchaseOrdersOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1228,62 +1174,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingPurchaseOrdersOneResponse( - get_purchase_order_response=utils.unmarshal_json( - http_res.text, Optional[models.GetPurchaseOrderResponse] + get_purchase_order_response=unmarshal_json_response( + Optional[models.GetPurchaseOrderResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingPurchaseOrdersOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1520,62 +1455,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingPurchaseOrdersUpdateResponse( - update_purchase_order_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdatePurchaseOrderResponse] + update_purchase_order_response=unmarshal_json_response( + Optional[models.UpdatePurchaseOrderResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingPurchaseOrdersUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1812,62 +1736,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingPurchaseOrdersUpdateResponse( - update_purchase_order_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdatePurchaseOrderResponse] + update_purchase_order_response=unmarshal_json_response( + Optional[models.UpdatePurchaseOrderResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingPurchaseOrdersUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1964,62 +1877,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingPurchaseOrdersDeleteResponse( - delete_purchase_order_response=utils.unmarshal_json( - http_res.text, Optional[models.DeletePurchaseOrderResponse] + delete_purchase_order_response=unmarshal_json_response( + Optional[models.DeletePurchaseOrderResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingPurchaseOrdersDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -2116,59 +2018,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingPurchaseOrdersDeleteResponse( - delete_purchase_order_response=utils.unmarshal_json( - http_res.text, Optional[models.DeletePurchaseOrderResponse] + delete_purchase_order_response=unmarshal_json_response( + Optional[models.DeletePurchaseOrderResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingPurchaseOrdersDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/sessions.py b/src/apideck_unify/sessions.py index 61d5e5f2..4aa88573 100644 --- a/src/apideck_unify/sessions.py +++ b/src/apideck_unify/sessions.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Mapping, Optional, Union @@ -105,62 +106,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultSessionsCreateResponse( - create_session_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateSessionResponse] + create_session_response=unmarshal_json_response( + Optional[models.CreateSessionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultSessionsCreateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -258,59 +248,48 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultSessionsCreateResponse( - create_session_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateSessionResponse] + create_session_response=unmarshal_json_response( + Optional[models.CreateSessionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultSessionsCreateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/sharedlinks.py b/src/apideck_unify/sharedlinks.py index ebef2f3c..e917da98 100644 --- a/src/apideck_unify/sharedlinks.py +++ b/src/apideck_unify/sharedlinks.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -137,64 +138,53 @@ def next_func() -> Optional[models.FileStorageSharedLinksAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageSharedLinksAllResponse( - get_shared_links_response=utils.unmarshal_json( - http_res.text, Optional[models.GetSharedLinksResponse] + get_shared_links_response=unmarshal_json_response( + Optional[models.GetSharedLinksResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageSharedLinksAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -323,64 +313,53 @@ def next_func() -> Optional[models.FileStorageSharedLinksAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageSharedLinksAllResponse( - get_shared_links_response=utils.unmarshal_json( - http_res.text, Optional[models.GetSharedLinksResponse] + get_shared_links_response=unmarshal_json_response( + Optional[models.GetSharedLinksResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageSharedLinksAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -498,62 +477,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.FileStorageSharedLinksAddResponse( - create_shared_link_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateSharedLinkResponse] + create_shared_link_response=unmarshal_json_response( + Optional[models.CreateSharedLinkResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageSharedLinksAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -671,62 +639,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.FileStorageSharedLinksAddResponse( - create_shared_link_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateSharedLinkResponse] + create_shared_link_response=unmarshal_json_response( + Optional[models.CreateSharedLinkResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageSharedLinksAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -826,62 +783,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageSharedLinksOneResponse( - get_shared_link_response=utils.unmarshal_json( - http_res.text, Optional[models.GetSharedLinkResponse] + get_shared_link_response=unmarshal_json_response( + Optional[models.GetSharedLinkResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageSharedLinksOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -981,62 +927,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageSharedLinksOneResponse( - get_shared_link_response=utils.unmarshal_json( - http_res.text, Optional[models.GetSharedLinkResponse] + get_shared_link_response=unmarshal_json_response( + Optional[models.GetSharedLinkResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageSharedLinksOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1157,62 +1092,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageSharedLinksUpdateResponse( - update_shared_link_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateSharedLinkResponse] + update_shared_link_response=unmarshal_json_response( + Optional[models.UpdateSharedLinkResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageSharedLinksUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1333,62 +1257,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageSharedLinksUpdateResponse( - update_shared_link_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateSharedLinkResponse] + update_shared_link_response=unmarshal_json_response( + Optional[models.UpdateSharedLinkResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageSharedLinksUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1485,62 +1398,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageSharedLinksDeleteResponse( - delete_shared_link_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteSharedLinkResponse] + delete_shared_link_response=unmarshal_json_response( + Optional[models.DeleteSharedLinkResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageSharedLinksDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1637,59 +1539,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageSharedLinksDeleteResponse( - delete_shared_link_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteSharedLinkResponse] + delete_shared_link_response=unmarshal_json_response( + Optional[models.DeleteSharedLinkResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageSharedLinksDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/stores.py b/src/apideck_unify/stores.py index 46005e05..5c38ac78 100644 --- a/src/apideck_unify/stores.py +++ b/src/apideck_unify/stores.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Mapping, Optional @@ -104,62 +105,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.EcommerceStoresOneResponse( - get_store_response=utils.unmarshal_json( - http_res.text, Optional[models.GetStoreResponse] + get_store_response=unmarshal_json_response( + Optional[models.GetStoreResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.EcommerceStoresOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -256,59 +246,48 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.EcommerceStoresOneResponse( - get_store_response=utils.unmarshal_json( - http_res.text, Optional[models.GetStoreResponse] + get_store_response=unmarshal_json_response( + Optional[models.GetStoreResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.EcommerceStoresOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/subsidiaries.py b/src/apideck_unify/subsidiaries.py index 9aa52ae9..8fc73388 100644 --- a/src/apideck_unify/subsidiaries.py +++ b/src/apideck_unify/subsidiaries.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -133,64 +134,53 @@ def next_func() -> Optional[models.AccountingSubsidiariesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingSubsidiariesAllResponse( - get_subsidiaries_response=utils.unmarshal_json( - http_res.text, Optional[models.GetSubsidiariesResponse] + get_subsidiaries_response=unmarshal_json_response( + Optional[models.GetSubsidiariesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingSubsidiariesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -315,64 +305,53 @@ def next_func() -> Optional[models.AccountingSubsidiariesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingSubsidiariesAllResponse( - get_subsidiaries_response=utils.unmarshal_json( - http_res.text, Optional[models.GetSubsidiariesResponse] + get_subsidiaries_response=unmarshal_json_response( + Optional[models.GetSubsidiariesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingSubsidiariesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -490,62 +469,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingSubsidiariesAddResponse( - create_subsidiary_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateSubsidiaryResponse] + create_subsidiary_response=unmarshal_json_response( + Optional[models.CreateSubsidiaryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingSubsidiariesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -663,62 +631,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingSubsidiariesAddResponse( - create_subsidiary_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateSubsidiaryResponse] + create_subsidiary_response=unmarshal_json_response( + Optional[models.CreateSubsidiaryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingSubsidiariesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -818,62 +775,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingSubsidiariesOneResponse( - get_subsidiary_response=utils.unmarshal_json( - http_res.text, Optional[models.GetSubsidiaryResponse] + get_subsidiary_response=unmarshal_json_response( + Optional[models.GetSubsidiaryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingSubsidiariesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -973,62 +919,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingSubsidiariesOneResponse( - get_subsidiary_response=utils.unmarshal_json( - http_res.text, Optional[models.GetSubsidiaryResponse] + get_subsidiary_response=unmarshal_json_response( + Optional[models.GetSubsidiaryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingSubsidiariesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1149,62 +1084,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingSubsidiariesUpdateResponse( - update_subsidiary_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateSubsidiaryResponse] + update_subsidiary_response=unmarshal_json_response( + Optional[models.UpdateSubsidiaryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingSubsidiariesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1325,62 +1249,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingSubsidiariesUpdateResponse( - update_subsidiary_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateSubsidiaryResponse] + update_subsidiary_response=unmarshal_json_response( + Optional[models.UpdateSubsidiaryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingSubsidiariesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1477,62 +1390,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingSubsidiariesDeleteResponse( - delete_subsidiary_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteSubsidiaryResponse] + delete_subsidiary_response=unmarshal_json_response( + Optional[models.DeleteSubsidiaryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingSubsidiariesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1629,59 +1531,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingSubsidiariesDeleteResponse( - delete_subsidiary_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteSubsidiaryResponse] + delete_subsidiary_response=unmarshal_json_response( + Optional[models.DeleteSubsidiaryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingSubsidiariesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/suppliers.py b/src/apideck_unify/suppliers.py index ef15a38d..d259dc5a 100644 --- a/src/apideck_unify/suppliers.py +++ b/src/apideck_unify/suppliers.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -149,64 +150,53 @@ def next_func() -> Optional[models.AccountingSuppliersAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingSuppliersAllResponse( - get_suppliers_response=utils.unmarshal_json( - http_res.text, Optional[models.GetSuppliersResponse] + get_suppliers_response=unmarshal_json_response( + Optional[models.GetSuppliersResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingSuppliersAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -347,64 +337,53 @@ def next_func() -> Optional[models.AccountingSuppliersAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingSuppliersAllResponse( - get_suppliers_response=utils.unmarshal_json( - http_res.text, Optional[models.GetSuppliersResponse] + get_suppliers_response=unmarshal_json_response( + Optional[models.GetSuppliersResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingSuppliersAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -451,6 +430,7 @@ def create( ] = UNSET, status: OptionalNullable[models.SupplierStatus] = UNSET, payment_method: OptionalNullable[str] = UNSET, + terms: OptionalNullable[str] = UNSET, channel: OptionalNullable[str] = UNSET, custom_fields: Optional[ Union[List[models.CustomField], List[models.CustomFieldTypedDict]] @@ -496,6 +476,7 @@ def create( :param account: :param status: Supplier status :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param terms: Terms of payment. :param channel: The channel through which the transaction is processed. :param custom_fields: :param row_version: A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -557,6 +538,7 @@ def create( ), status=status, payment_method=payment_method, + terms=terms, channel=channel, custom_fields=utils.get_pydantic_model( custom_fields, Optional[List[models.CustomField]] @@ -622,62 +604,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingSuppliersAddResponse( - create_supplier_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateSupplierResponse] + create_supplier_response=unmarshal_json_response( + Optional[models.CreateSupplierResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingSuppliersAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -724,6 +695,7 @@ async def create_async( ] = UNSET, status: OptionalNullable[models.SupplierStatus] = UNSET, payment_method: OptionalNullable[str] = UNSET, + terms: OptionalNullable[str] = UNSET, channel: OptionalNullable[str] = UNSET, custom_fields: Optional[ Union[List[models.CustomField], List[models.CustomFieldTypedDict]] @@ -769,6 +741,7 @@ async def create_async( :param account: :param status: Supplier status :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param terms: Terms of payment. :param channel: The channel through which the transaction is processed. :param custom_fields: :param row_version: A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -830,6 +803,7 @@ async def create_async( ), status=status, payment_method=payment_method, + terms=terms, channel=channel, custom_fields=utils.get_pydantic_model( custom_fields, Optional[List[models.CustomField]] @@ -895,62 +869,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingSuppliersAddResponse( - create_supplier_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateSupplierResponse] + create_supplier_response=unmarshal_json_response( + Optional[models.CreateSupplierResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingSuppliersAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -1050,62 +1013,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingSuppliersOneResponse( - get_supplier_response=utils.unmarshal_json( - http_res.text, Optional[models.GetSupplierResponse] + get_supplier_response=unmarshal_json_response( + Optional[models.GetSupplierResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingSuppliersOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1205,62 +1157,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingSuppliersOneResponse( - get_supplier_response=utils.unmarshal_json( - http_res.text, Optional[models.GetSupplierResponse] + get_supplier_response=unmarshal_json_response( + Optional[models.GetSupplierResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingSuppliersOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1308,6 +1249,7 @@ def update( ] = UNSET, status: OptionalNullable[models.SupplierStatus] = UNSET, payment_method: OptionalNullable[str] = UNSET, + terms: OptionalNullable[str] = UNSET, channel: OptionalNullable[str] = UNSET, custom_fields: Optional[ Union[List[models.CustomField], List[models.CustomFieldTypedDict]] @@ -1354,6 +1296,7 @@ def update( :param account: :param status: Supplier status :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param terms: Terms of payment. :param channel: The channel through which the transaction is processed. :param custom_fields: :param row_version: A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -1416,6 +1359,7 @@ def update( ), status=status, payment_method=payment_method, + terms=terms, channel=channel, custom_fields=utils.get_pydantic_model( custom_fields, Optional[List[models.CustomField]] @@ -1481,62 +1425,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingSuppliersUpdateResponse( - update_supplier_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateSupplierResponse] + update_supplier_response=unmarshal_json_response( + Optional[models.UpdateSupplierResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingSuppliersUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1584,6 +1517,7 @@ async def update_async( ] = UNSET, status: OptionalNullable[models.SupplierStatus] = UNSET, payment_method: OptionalNullable[str] = UNSET, + terms: OptionalNullable[str] = UNSET, channel: OptionalNullable[str] = UNSET, custom_fields: Optional[ Union[List[models.CustomField], List[models.CustomFieldTypedDict]] @@ -1630,6 +1564,7 @@ async def update_async( :param account: :param status: Supplier status :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param terms: Terms of payment. :param channel: The channel through which the transaction is processed. :param custom_fields: :param row_version: A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -1692,6 +1627,7 @@ async def update_async( ), status=status, payment_method=payment_method, + terms=terms, channel=channel, custom_fields=utils.get_pydantic_model( custom_fields, Optional[List[models.CustomField]] @@ -1757,62 +1693,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingSuppliersUpdateResponse( - update_supplier_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateSupplierResponse] + update_supplier_response=unmarshal_json_response( + Optional[models.UpdateSupplierResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingSuppliersUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1909,62 +1834,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingSuppliersDeleteResponse( - delete_supplier_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteSupplierResponse] + delete_supplier_response=unmarshal_json_response( + Optional[models.DeleteSupplierResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingSuppliersDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -2061,59 +1975,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingSuppliersDeleteResponse( - delete_supplier_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteSupplierResponse] + delete_supplier_response=unmarshal_json_response( + Optional[models.DeleteSupplierResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingSuppliersDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/taxrates.py b/src/apideck_unify/taxrates.py index 91864772..178f26ed 100644 --- a/src/apideck_unify/taxrates.py +++ b/src/apideck_unify/taxrates.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -144,64 +145,53 @@ def next_func() -> Optional[models.AccountingTaxRatesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingTaxRatesAllResponse( - get_tax_rates_response=utils.unmarshal_json( - http_res.text, Optional[models.GetTaxRatesResponse] + get_tax_rates_response=unmarshal_json_response( + Optional[models.GetTaxRatesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingTaxRatesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -337,64 +327,53 @@ def next_func() -> Optional[models.AccountingTaxRatesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingTaxRatesAllResponse( - get_tax_rates_response=utils.unmarshal_json( - http_res.text, Optional[models.GetTaxRatesResponse] + get_tax_rates_response=unmarshal_json_response( + Optional[models.GetTaxRatesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingTaxRatesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -562,62 +541,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingTaxRatesAddResponse( - create_tax_rate_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateTaxRateResponse] + create_tax_rate_response=unmarshal_json_response( + Optional[models.CreateTaxRateResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingTaxRatesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -785,62 +753,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingTaxRatesAddResponse( - create_tax_rate_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateTaxRateResponse] + create_tax_rate_response=unmarshal_json_response( + Optional[models.CreateTaxRateResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingTaxRatesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -941,62 +898,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingTaxRatesOneResponse( - get_tax_rate_response=utils.unmarshal_json( - http_res.text, Optional[models.GetTaxRateResponse] + get_tax_rate_response=unmarshal_json_response( + Optional[models.GetTaxRateResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingTaxRatesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1097,62 +1043,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingTaxRatesOneResponse( - get_tax_rate_response=utils.unmarshal_json( - http_res.text, Optional[models.GetTaxRateResponse] + get_tax_rate_response=unmarshal_json_response( + Optional[models.GetTaxRateResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingTaxRatesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1323,62 +1258,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingTaxRatesUpdateResponse( - update_tax_rate_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateTaxRateResponse] + update_tax_rate_response=unmarshal_json_response( + Optional[models.UpdateTaxRateResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingTaxRatesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1549,62 +1473,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingTaxRatesUpdateResponse( - update_tax_rate_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateTaxRateResponse] + update_tax_rate_response=unmarshal_json_response( + Optional[models.UpdateTaxRateResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingTaxRatesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1701,62 +1614,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingTaxRatesDeleteResponse( - delete_tax_rate_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteTaxRateResponse] + delete_tax_rate_response=unmarshal_json_response( + Optional[models.DeleteTaxRateResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingTaxRatesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1853,59 +1755,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingTaxRatesDeleteResponse( - delete_tax_rate_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteTaxRateResponse] + delete_tax_rate_response=unmarshal_json_response( + Optional[models.DeleteTaxRateResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingTaxRatesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/timeoffrequests.py b/src/apideck_unify/timeoffrequests.py index f02d0d79..7b3dff7f 100644 --- a/src/apideck_unify/timeoffrequests.py +++ b/src/apideck_unify/timeoffrequests.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -145,64 +146,53 @@ def next_func() -> Optional[models.HrisTimeOffRequestsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisTimeOffRequestsAllResponse( - get_time_off_requests_response=utils.unmarshal_json( - http_res.text, Optional[models.GetTimeOffRequestsResponse] + get_time_off_requests_response=unmarshal_json_response( + Optional[models.GetTimeOffRequestsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisTimeOffRequestsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -339,64 +329,53 @@ def next_func() -> Optional[models.HrisTimeOffRequestsAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisTimeOffRequestsAllResponse( - get_time_off_requests_response=utils.unmarshal_json( - http_res.text, Optional[models.GetTimeOffRequestsResponse] + get_time_off_requests_response=unmarshal_json_response( + Optional[models.GetTimeOffRequestsResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisTimeOffRequestsAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -548,62 +527,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.HrisTimeOffRequestsAddResponse( - create_time_off_request_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateTimeOffRequestResponse] + create_time_off_request_response=unmarshal_json_response( + Optional[models.CreateTimeOffRequestResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisTimeOffRequestsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -755,62 +723,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.HrisTimeOffRequestsAddResponse( - create_time_off_request_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateTimeOffRequestResponse] + create_time_off_request_response=unmarshal_json_response( + Optional[models.CreateTimeOffRequestResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisTimeOffRequestsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -913,62 +870,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisTimeOffRequestsOneResponse( - get_time_off_request_response=utils.unmarshal_json( - http_res.text, Optional[models.GetTimeOffRequestResponse] + get_time_off_request_response=unmarshal_json_response( + Optional[models.GetTimeOffRequestResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisTimeOffRequestsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1071,62 +1017,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisTimeOffRequestsOneResponse( - get_time_off_request_response=utils.unmarshal_json( - http_res.text, Optional[models.GetTimeOffRequestResponse] + get_time_off_request_response=unmarshal_json_response( + Optional[models.GetTimeOffRequestResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisTimeOffRequestsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1284,62 +1219,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisTimeOffRequestsUpdateResponse( - update_time_off_request_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateTimeOffRequestResponse] + update_time_off_request_response=unmarshal_json_response( + Optional[models.UpdateTimeOffRequestResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisTimeOffRequestsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1497,62 +1421,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisTimeOffRequestsUpdateResponse( - update_time_off_request_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateTimeOffRequestResponse] + update_time_off_request_response=unmarshal_json_response( + Optional[models.UpdateTimeOffRequestResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisTimeOffRequestsUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1652,62 +1565,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisTimeOffRequestsDeleteResponse( - delete_time_off_request_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteTimeOffRequestResponse] + delete_time_off_request_response=unmarshal_json_response( + Optional[models.DeleteTimeOffRequestResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisTimeOffRequestsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1807,59 +1709,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.HrisTimeOffRequestsDeleteResponse( - delete_time_off_request_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteTimeOffRequestResponse] + delete_time_off_request_response=unmarshal_json_response( + Optional[models.DeleteTimeOffRequestResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.HrisTimeOffRequestsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/trackingcategories.py b/src/apideck_unify/trackingcategories.py index a006282a..d76e5201 100644 --- a/src/apideck_unify/trackingcategories.py +++ b/src/apideck_unify/trackingcategories.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -137,64 +138,53 @@ def next_func() -> Optional[models.AccountingTrackingCategoriesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingTrackingCategoriesAllResponse( - get_tracking_categories_response=utils.unmarshal_json( - http_res.text, Optional[models.GetTrackingCategoriesResponse] + get_tracking_categories_response=unmarshal_json_response( + Optional[models.GetTrackingCategoriesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingTrackingCategoriesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -323,64 +313,53 @@ def next_func() -> Optional[models.AccountingTrackingCategoriesAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingTrackingCategoriesAllResponse( - get_tracking_categories_response=utils.unmarshal_json( - http_res.text, Optional[models.GetTrackingCategoriesResponse] + get_tracking_categories_response=unmarshal_json_response( + Optional[models.GetTrackingCategoriesResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingTrackingCategoriesAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -515,62 +494,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingTrackingCategoriesAddResponse( - create_tracking_category_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateTrackingCategoryResponse] + create_tracking_category_response=unmarshal_json_response( + Optional[models.CreateTrackingCategoryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingTrackingCategoriesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -705,62 +673,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.AccountingTrackingCategoriesAddResponse( - create_tracking_category_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateTrackingCategoryResponse] + create_tracking_category_response=unmarshal_json_response( + Optional[models.CreateTrackingCategoryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingTrackingCategoriesAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -860,62 +817,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingTrackingCategoriesOneResponse( - get_tracking_category_response=utils.unmarshal_json( - http_res.text, Optional[models.GetTrackingCategoryResponse] + get_tracking_category_response=unmarshal_json_response( + Optional[models.GetTrackingCategoryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingTrackingCategoriesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1015,62 +961,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingTrackingCategoriesOneResponse( - get_tracking_category_response=utils.unmarshal_json( - http_res.text, Optional[models.GetTrackingCategoryResponse] + get_tracking_category_response=unmarshal_json_response( + Optional[models.GetTrackingCategoryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingTrackingCategoriesOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1208,62 +1143,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingTrackingCategoriesUpdateResponse( - update_tracking_category_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateTrackingCategoryResponse] + update_tracking_category_response=unmarshal_json_response( + Optional[models.UpdateTrackingCategoryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingTrackingCategoriesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1401,62 +1325,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingTrackingCategoriesUpdateResponse( - update_tracking_category_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateTrackingCategoryResponse] + update_tracking_category_response=unmarshal_json_response( + Optional[models.UpdateTrackingCategoryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingTrackingCategoriesUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1553,62 +1466,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingTrackingCategoriesDeleteResponse( - delete_tracking_category_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteTrackingCategoryResponse] + delete_tracking_category_response=unmarshal_json_response( + Optional[models.DeleteTrackingCategoryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingTrackingCategoriesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1705,59 +1607,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.AccountingTrackingCategoriesDeleteResponse( - delete_tracking_category_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteTrackingCategoryResponse] + delete_tracking_category_response=unmarshal_json_response( + Optional[models.DeleteTrackingCategoryResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.AccountingTrackingCategoriesDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/uploadsessions.py b/src/apideck_unify/uploadsessions.py index 6f7cdb9d..8332bd38 100644 --- a/src/apideck_unify/uploadsessions.py +++ b/src/apideck_unify/uploadsessions.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response import io from typing import Any, IO, List, Mapping, Optional, Union @@ -130,62 +131,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.FileStorageUploadSessionsAddResponse( - create_upload_session_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateUploadSessionResponse] + create_upload_session_response=unmarshal_json_response( + Optional[models.CreateUploadSessionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageUploadSessionsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -307,62 +297,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.FileStorageUploadSessionsAddResponse( - create_upload_session_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateUploadSessionResponse] + create_upload_session_response=unmarshal_json_response( + Optional[models.CreateUploadSessionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageUploadSessionsAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -462,62 +441,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageUploadSessionsOneResponse( - get_upload_session_response=utils.unmarshal_json( - http_res.text, Optional[models.GetUploadSessionResponse] + get_upload_session_response=unmarshal_json_response( + Optional[models.GetUploadSessionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageUploadSessionsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -617,62 +585,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageUploadSessionsOneResponse( - get_upload_session_response=utils.unmarshal_json( - http_res.text, Optional[models.GetUploadSessionResponse] + get_upload_session_response=unmarshal_json_response( + Optional[models.GetUploadSessionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageUploadSessionsOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def upload( self, @@ -785,62 +742,51 @@ def upload( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageUploadSessionsUploadResponse( - update_upload_session_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateUploadSessionResponse] + update_upload_session_response=unmarshal_json_response( + Optional[models.UpdateUploadSessionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageUploadSessionsUploadResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def upload_async( self, @@ -953,62 +899,51 @@ async def upload_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageUploadSessionsUploadResponse( - update_upload_session_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateUploadSessionResponse] + update_upload_session_response=unmarshal_json_response( + Optional[models.UpdateUploadSessionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageUploadSessionsUploadResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1105,62 +1040,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageUploadSessionsDeleteResponse( - delete_upload_session_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteUploadSessionResponse] + delete_upload_session_response=unmarshal_json_response( + Optional[models.DeleteUploadSessionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageUploadSessionsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1257,62 +1181,51 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.FileStorageUploadSessionsDeleteResponse( - delete_upload_session_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteUploadSessionResponse] + delete_upload_session_response=unmarshal_json_response( + Optional[models.DeleteUploadSessionResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageUploadSessionsDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def finish( self, @@ -1430,62 +1343,51 @@ def finish( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.FileStorageUploadSessionsFinishResponse( - get_file_response=utils.unmarshal_json( - http_res.text, Optional[models.GetFileResponse] + get_file_response=unmarshal_json_response( + Optional[models.GetFileResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageUploadSessionsFinishResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def finish_async( self, @@ -1603,59 +1505,48 @@ async def finish_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.FileStorageUploadSessionsFinishResponse( - get_file_response=utils.unmarshal_json( - http_res.text, Optional[models.GetFileResponse] + get_file_response=unmarshal_json_response( + Optional[models.GetFileResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.FileStorageUploadSessionsFinishResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/users.py b/src/apideck_unify/users.py index 8aa04116..b367a283 100644 --- a/src/apideck_unify/users.py +++ b/src/apideck_unify/users.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -137,64 +138,53 @@ def next_func() -> Optional[models.CrmUsersAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmUsersAllResponse( - get_users_response=utils.unmarshal_json( - http_res.text, Optional[models.GetUsersResponse] + get_users_response=unmarshal_json_response( + Optional[models.GetUsersResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmUsersAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -323,64 +313,53 @@ def next_func() -> Optional[models.CrmUsersAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmUsersAllResponse( - get_users_response=utils.unmarshal_json( - http_res.text, Optional[models.GetUsersResponse] + get_users_response=unmarshal_json_response( + Optional[models.GetUsersResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmUsersAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -545,62 +524,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.CrmUsersAddResponse( - create_user_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateUserResponse] + create_user_response=unmarshal_json_response( + Optional[models.CreateUserResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmUsersAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -765,62 +733,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.CrmUsersAddResponse( - create_user_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateUserResponse] + create_user_response=unmarshal_json_response( + Optional[models.CreateUserResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmUsersAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -920,62 +877,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmUsersOneResponse( - get_user_response=utils.unmarshal_json( - http_res.text, Optional[models.GetUserResponse] + get_user_response=unmarshal_json_response( + Optional[models.GetUserResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmUsersOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -1075,62 +1021,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmUsersOneResponse( - get_user_response=utils.unmarshal_json( - http_res.text, Optional[models.GetUserResponse] + get_user_response=unmarshal_json_response( + Optional[models.GetUserResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmUsersOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1298,62 +1233,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmUsersUpdateResponse( - update_user_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateUserResponse] + update_user_response=unmarshal_json_response( + Optional[models.UpdateUserResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmUsersUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1521,62 +1445,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmUsersUpdateResponse( - update_user_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateUserResponse] + update_user_response=unmarshal_json_response( + Optional[models.UpdateUserResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmUsersUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1673,62 +1586,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmUsersDeleteResponse( - delete_user_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteUserResponse] + delete_user_response=unmarshal_json_response( + Optional[models.DeleteUserResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmUsersDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1825,59 +1727,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.CrmUsersDeleteResponse( - delete_user_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteUserResponse] + delete_user_response=unmarshal_json_response( + Optional[models.DeleteUserResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.CrmUsersDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/utils/serializers.py b/src/apideck_unify/utils/serializers.py index 76e44d71..378a14c0 100644 --- a/src/apideck_unify/utils/serializers.py +++ b/src/apideck_unify/utils/serializers.py @@ -192,7 +192,9 @@ def is_union(obj: object) -> bool: """ Returns True if the given object is a typing.Union or typing_extensions.Union. """ - return any(obj is typing_obj for typing_obj in _get_typing_objects_by_name_of("Union")) + return any( + obj is typing_obj for typing_obj in _get_typing_objects_by_name_of("Union") + ) def stream_to_text(stream: httpx.Response) -> str: @@ -245,4 +247,3 @@ def _get_typing_objects_by_name_of(name: str) -> Tuple[Any, ...]: f"Neither typing nor typing_extensions has an object called {name!r}" ) return result - diff --git a/src/apideck_unify/utils/unmarshal_json_response.py b/src/apideck_unify/utils/unmarshal_json_response.py new file mode 100644 index 00000000..032c15e4 --- /dev/null +++ b/src/apideck_unify/utils/unmarshal_json_response.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import Any, Optional + +import httpx + +from .serializers import unmarshal_json +from apideck_unify import models + + +def unmarshal_json_response( + typ: Any, http_res: httpx.Response, body: Optional[str] = None +) -> Any: + if body is None: + body = http_res.text + try: + return unmarshal_json(body, typ) + except Exception as e: + raise models.ResponseValidationError( + "Response validation failed", + http_res, + e, + body, + ) from e diff --git a/src/apideck_unify/validateconnection.py b/src/apideck_unify/validateconnection.py index 1566495b..584e647f 100644 --- a/src/apideck_unify/validateconnection.py +++ b/src/apideck_unify/validateconnection.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Mapping, Optional, Union @@ -124,62 +125,51 @@ def state( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultValidateConnectionStateResponse( - validate_connection_state_response=utils.unmarshal_json( - http_res.text, Optional[models.ValidateConnectionStateResponse] + validate_connection_state_response=unmarshal_json_response( + Optional[models.ValidateConnectionStateResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultValidateConnectionStateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def state_async( self, @@ -296,59 +286,48 @@ async def state_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.VaultValidateConnectionStateResponse( - validate_connection_state_response=utils.unmarshal_json( - http_res.text, Optional[models.ValidateConnectionStateResponse] + validate_connection_state_response=unmarshal_json_response( + Optional[models.ValidateConnectionStateResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.VaultValidateConnectionStateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/src/apideck_unify/webhooks.py b/src/apideck_unify/webhooks.py index b4707f09..84baff40 100644 --- a/src/apideck_unify/webhooks.py +++ b/src/apideck_unify/webhooks.py @@ -5,6 +5,7 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response from jsonpath import JSONPath from typing import Any, Dict, List, Mapping, Optional, Union @@ -116,64 +117,53 @@ def next_func() -> Optional[models.WebhookWebhooksAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.WebhookWebhooksAllResponse( - get_webhooks_response=utils.unmarshal_json( - http_res.text, Optional[models.GetWebhooksResponse] + get_webhooks_response=unmarshal_json_response( + Optional[models.GetWebhooksResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.WebhookWebhooksAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def list_async( self, @@ -281,64 +271,53 @@ def next_func() -> Optional[models.WebhookWebhooksAllResponse]: response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.WebhookWebhooksAllResponse( - get_webhooks_response=utils.unmarshal_json( - http_res.text, Optional[models.GetWebhooksResponse] + get_webhooks_response=unmarshal_json_response( + Optional[models.GetWebhooksResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.WebhookWebhooksAllResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), next=next_func, ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def create( self, @@ -446,62 +425,51 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.WebhookWebhooksAddResponse( - create_webhook_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateWebhookResponse] + create_webhook_response=unmarshal_json_response( + Optional[models.CreateWebhookResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.WebhookWebhooksAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def create_async( self, @@ -609,62 +577,51 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): return models.WebhookWebhooksAddResponse( - create_webhook_response=utils.unmarshal_json( - http_res.text, Optional[models.CreateWebhookResponse] + create_webhook_response=unmarshal_json_response( + Optional[models.CreateWebhookResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.WebhookWebhooksAddResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def get( self, @@ -751,62 +708,51 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.WebhookWebhooksOneResponse( - get_webhook_response=utils.unmarshal_json( - http_res.text, Optional[models.GetWebhookResponse] + get_webhook_response=unmarshal_json_response( + Optional[models.GetWebhookResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.WebhookWebhooksOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def get_async( self, @@ -893,62 +839,51 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.WebhookWebhooksOneResponse( - get_webhook_response=utils.unmarshal_json( - http_res.text, Optional[models.GetWebhookResponse] + get_webhook_response=unmarshal_json_response( + Optional[models.GetWebhookResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.WebhookWebhooksOneResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def update( self, @@ -1056,62 +991,51 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.WebhookWebhooksUpdateResponse( - update_webhook_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateWebhookResponse] + update_webhook_response=unmarshal_json_response( + Optional[models.UpdateWebhookResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.WebhookWebhooksUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def update_async( self, @@ -1219,62 +1143,51 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.WebhookWebhooksUpdateResponse( - update_webhook_response=utils.unmarshal_json( - http_res.text, Optional[models.UpdateWebhookResponse] + update_webhook_response=unmarshal_json_response( + Optional[models.UpdateWebhookResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.WebhookWebhooksUpdateResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) def delete( self, @@ -1361,62 +1274,51 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.WebhookWebhooksDeleteResponse( - delete_webhook_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteWebhookResponse] + delete_webhook_response=unmarshal_json_response( + Optional[models.DeleteWebhookResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.WebhookWebhooksDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) async def delete_async( self, @@ -1503,59 +1405,48 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return models.WebhookWebhooksDeleteResponse( - delete_webhook_response=utils.unmarshal_json( - http_res.text, Optional[models.DeleteWebhookResponse] + delete_webhook_response=unmarshal_json_response( + Optional[models.DeleteWebhookResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.BadRequestResponseData + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res ) - raise models.BadRequestResponse(data=response_data) + raise models.BadRequestResponse(response_data, http_res) if utils.match_response(http_res, "401", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnauthorizedResponseData + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res ) - raise models.UnauthorizedResponse(data=response_data) + raise models.UnauthorizedResponse(response_data, http_res) if utils.match_response(http_res, "402", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.PaymentRequiredResponseData + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res ) - raise models.PaymentRequiredResponse(data=response_data) + raise models.PaymentRequiredResponse(response_data, http_res) if utils.match_response(http_res, "404", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.NotFoundResponseData + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res ) - raise models.NotFoundResponse(data=response_data) + raise models.NotFoundResponse(response_data, http_res) if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.UnprocessableResponseData + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res ) - raise models.UnprocessableResponse(data=response_data) + raise models.UnprocessableResponse(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise models.APIError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "default", "application/json"): return models.WebhookWebhooksDeleteResponse( - unexpected_error_response=utils.unmarshal_json( - http_res.text, Optional[models.UnexpectedErrorResponse] + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res ), http_meta=models.HTTPMetadata(request=req, response=http_res), ) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.APIError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise models.APIError("Unexpected response received", http_res) diff --git a/tests/mockserver/.gitignore b/tests/mockserver/.gitignore deleted file mode 100644 index 9544318b..00000000 --- a/tests/mockserver/.gitignore +++ /dev/null @@ -1 +0,0 @@ -_debug diff --git a/tests/mockserver/Dockerfile b/tests/mockserver/Dockerfile deleted file mode 100644 index efdea18c..00000000 --- a/tests/mockserver/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM golang:1.23 - -WORKDIR /usr/src/app - -COPY go.mod go.sum ./ -RUN go mod download && go mod verify -COPY . . -COPY *testdata /usr/local/bin/testdata -RUN go build -v -o /usr/local/bin/mockserver . -EXPOSE 18080 -ENTRYPOINT ["mockserver"] diff --git a/tests/mockserver/Makefile b/tests/mockserver/Makefile deleted file mode 100644 index 2ae6a36c..00000000 --- a/tests/mockserver/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -.PHONY: start - -start: - @if command -v docker >/dev/null 2>&1; then \ - echo "Starting mock server with Docker..."; \ - docker build -t mockserver . && \ - docker run -i -p 18080:18080 -t --rm mockserver; \ - elif command -v go >/dev/null 2>&1; then \ - echo "Docker not found. Starting mock server with Go..."; \ - go run .; \ - else \ - echo "Neither Docker nor Go found. To run the mock server:"; \ - echo "\nOption 1 - Using Docker:"; \ - echo " docker build -t mockserver ."; \ - echo " docker run -i -p 18080:18080 -t --rm mockserver"; \ - echo "\nOption 2 - Using Go:"; \ - echo " go run ."; \ - fi diff --git a/tests/mockserver/README.md b/tests/mockserver/README.md deleted file mode 100644 index c8424fd3..00000000 --- a/tests/mockserver/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# Mock Server - -A generated HTTP mock server based on your OpenAPI Specification (OAS). Use this mock server for integration and contract testing. - -## Usage - -The server can be built and started via the [Go programming language toolchain](https://go.dev/) or [Docker](https://www.docker.com/). - -If you have Go installed, start the server directly via: - -```shell -go run . -``` - -Otherwise, if you have Docker installed, build and run the server via: - -```shell -docker build -t mockserver . -docker run -i -p 18080:18080 -t --rm mockserver -``` - -By default, the server runs on port `18080`. - -### Server Paths - -The server contains generated paths from the OAS and the following additional built-in paths. - -| Path | Description | -|---|---| -| [`/_mockserver/health`](https://localhost:18080/_mockserver/health) | verify server is running | -| [`/_mockserver/log`](https://localhost:18080/_mockserver/log) | view per-OAS-operation logs | - -Any request outside the generated and built-in paths will return a `404 Not Found` response. - -### Server Customization - -The server supports the following flags for customization. - -| Flag | Default | Description | -|---|---|---| -| `-address` | `:18080` | server listen address | -| `-log-format` | `text` | logging format (supported: `JSON`, `text`) | -| `-log-level` | `INFO` | logging level (supported: `DEBUG`, `INFO`, `WARN`, `ERROR`) | - -For example, enabling server debug logging: - -```shell -# via `go run` -go run . -log-level=DEBUG -# via `docker run` -docker run -i -p 18080:18080 -t --rm mockserver -log-level=DEBUG -``` diff --git a/tests/mockserver/go.mod b/tests/mockserver/go.mod deleted file mode 100644 index 38b2d5e8..00000000 --- a/tests/mockserver/go.mod +++ /dev/null @@ -1,15 +0,0 @@ -module mockserver - -go 1.22 - -require ( - github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 - github.com/go-pkgz/expirable-cache/v3 v3.0.0 - github.com/gorilla/mux v1.8.1 -) - -require ( - github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/stretchr/testify v1.9.0 // indirect -) diff --git a/tests/mockserver/go.sum b/tests/mockserver/go.sum deleted file mode 100644 index fa86a5fc..00000000 --- a/tests/mockserver/go.sum +++ /dev/null @@ -1,16 +0,0 @@ -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 h1:S92OBrGuLLZsyM5ybUzgc/mPjIYk2AZqufieooe98uw= -github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05/go.mod h1:M9R1FoZ3y//hwwnJtO51ypFGwm8ZfpxPT/ZLtO1mcgQ= -github.com/go-pkgz/expirable-cache/v3 v3.0.0 h1:u3/gcu3sabLYiTCevoRKv+WzjIn5oo7P8XtiXBeRDLw= -github.com/go-pkgz/expirable-cache/v3 v3.0.0/go.mod h1:2OQiDyEGQalYecLWmXprm3maPXeVb5/6/X7yRPYTzec= -github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= -github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= -github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= -github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/tests/mockserver/internal/handler/assert/contenttype.go b/tests/mockserver/internal/handler/assert/contenttype.go deleted file mode 100644 index 42afbd06..00000000 --- a/tests/mockserver/internal/handler/assert/contenttype.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package assert - -import ( - "fmt" - "mime" - "net/http" - "strings" -) - -func ContentType(req *http.Request, expected string, isRequired bool) error { - got := req.Header.Get("Content-Type") - - if got == "" { - if isRequired { - return fmt.Errorf("expected Content-Type to be set, got: %s", got) - } - return nil - } - - mimeType, _, err := mime.ParseMediaType(got) - if err != nil { - return fmt.Errorf("got Content-Type %s is invalid: %w", got, err) - } - - expectedMimeType, _, err := mime.ParseMediaType(expected) - if err != nil { - return fmt.Errorf("expected Content-Type %s is invalid: %w", expected, err) - } - - if mimeType != expectedMimeType { - return fmt.Errorf( - "expected Content-Type to be %s, got: %s", - expected, - got, - ) - } - - return nil -} - -func AcceptHeader(req *http.Request, expectedValues []string) error { - if len(expectedValues) == 0 { - return nil - } - - gotAccept := req.Header.Get("Accept") - - gotValues := strings.Split(gotAccept, ",") - - for i, gotValue := range gotValues { - mimeType := strings.Split(strings.TrimSpace(gotValue), ";")[0] - - gotMimeType, _, err := mime.ParseMediaType(mimeType) - if err != nil { - return fmt.Errorf("got Accept value %s is invalid: %w", gotValue, err) - } - - gotValues[i] = gotMimeType - } - - allFound := true - - parsedExpectedValues := make([]string, len(expectedValues)) - - for i, expected := range expectedValues { - mimeType := strings.Split(expected, ";")[0] - - expectedMimeType, _, err := mime.ParseMediaType(mimeType) - if err != nil { - return fmt.Errorf("expected Accept value %s is invalid: %w", expected, err) - } - - parsedExpectedValues[i] = expectedMimeType - } - - for _, gotValue := range gotValues { - found := false - - for _, expected := range parsedExpectedValues { - if expected == gotValue { - found = true - break - } - } - - if !found { - allFound = false - break - } - } - - if !allFound { - return fmt.Errorf("expected Accept value to be one of %s, got: %s", strings.Join(parsedExpectedValues, ", "), gotAccept) - } - - return nil -} diff --git a/tests/mockserver/internal/handler/assert/header.go b/tests/mockserver/internal/handler/assert/header.go deleted file mode 100644 index 50f910d9..00000000 --- a/tests/mockserver/internal/handler/assert/header.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package assert - -import ( - "fmt" - "net/http" -) - -// HeaderExists generically verifies the given request header name exists with -// a single, non-empty value. If an unexpected value is found, it will return an -// error with a diagnostic text body and which should cause the handler to return -// immediately. -func HeaderExists(req *http.Request, name string) error { - values := req.Header.Values(name) - - if len(values) == 0 { - return fmt.Errorf("missing expected header %s", name) - } - - if len(values) > 1 { - return fmt.Errorf("expected single header for %s, got %d values", name, len(values)) - } - - got := values[0] - - if got == "" { - return fmt.Errorf("expected non-empty header %s", name) - } - - return nil -} - -// HeaderValues generically verifies the given request header name has the -// expected values. If an unexpected value is found, it will return an error -// with a diagnostic text body and which should cause the handler to return -// immediately. -func HeaderValues(req *http.Request, name string, expected []string) error { - got := req.Header.Values(name) - - if len(got) == 0 { - return fmt.Errorf( - "missing expected header %s which should be %v", - name, - expected, - ) - } - - if len(got) != len(expected) { - return fmt.Errorf( - "expected header %s to be %v, got: %v", - name, - expected, - got, - ) - } - - for index, expectedValue := range expected { - if got[index] != expectedValue { - return fmt.Errorf( - "expected header %s to be %v, got: %v", - name, - expected, - got, - ) - } - } - - return nil -} diff --git a/tests/mockserver/internal/handler/assert/parameter.go b/tests/mockserver/internal/handler/assert/parameter.go deleted file mode 100644 index f8a5e45a..00000000 --- a/tests/mockserver/internal/handler/assert/parameter.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package assert - -import ( - "fmt" - "net/http" - "net/url" -) - -// ParameterHeaderValues verifies the request header parameter key has the -// expected multiple values. If an unexpected value is found, it will return an -// error with a diagnostic text body and which should cause the handler to -// return immediately. -func ParameterHeaderValues(req *http.Request, key string, expected []string) error { - got := req.Header.Values(key) - - if len(got) == 0 { - return fmt.Errorf( - "missing expected header parameter %s which should be %v", - key, - expected, - ) - } - - if len(got) != len(expected) { - return fmt.Errorf( - "expected header parameter %s to be %s, got: %v", - key, - expected, - got, - ) - } - - for index, expectedValue := range expected { - if got[index] != expectedValue { - return fmt.Errorf( - "expected header parameter %s to be %v, got: %v", - key, - expected, - got, - ) - } - } - - return nil -} - -// ParameterPathValue verifies the request path parameter key has the expected -// value. If an unexpected value is found, it will return an error with -// a diagnostic text body and which should cause the handler to -// return immediately. -func ParameterPathValue(req *http.Request, key string, expected string) error { - got := req.PathValue(key) - - if got != expected { - return fmt.Errorf( - "expected path parameter %s to be %s, got: %s", - key, - expected, - got, - ) - } - - return nil -} - -// ParameterQueryValues verifies the request query parameter key has the -// expected multiple values. If an unexpected value is found, it will return an -// error with a diagnostic text body and which should cause the handler to -// return immediately. -func ParameterQueryValues(req *http.Request, key string, expected []string) error { - queryValues, err := url.ParseQuery(req.URL.RawQuery) - - if err != nil { - return fmt.Errorf("error parsing query parameters: %w", err) - } - - got, ok := queryValues[key] - - if !ok || len(got) == 0 { - return fmt.Errorf( - "missing expected query parameter %s which should be %v", - key, - expected, - ) - } - - if len(got) != len(expected) { - return fmt.Errorf( - "expected query parameter %s to be %s, got: %v", - key, - expected, - got, - ) - } - - for index, expectedValue := range expected { - if got[index] != expectedValue { - return fmt.Errorf( - "expected query parameter %s to be %v, got: %v", - key, - expected, - got, - ) - } - } - - return nil -} diff --git a/tests/mockserver/internal/handler/assert/pointer.go b/tests/mockserver/internal/handler/assert/pointer.go deleted file mode 100644 index fa03e4c8..00000000 --- a/tests/mockserver/internal/handler/assert/pointer.go +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package assert - -// Pointer returns a pointer to the given value. -// -// This is intended to simplify inline builtin value expressions that are not -// implemented in the Go language specification, such as a hypothetical -// &"example". -func Pointer[T any](v T) *T { - return &v -} diff --git a/tests/mockserver/internal/handler/assert/security.go b/tests/mockserver/internal/handler/assert/security.go deleted file mode 100644 index 7d0a714a..00000000 --- a/tests/mockserver/internal/handler/assert/security.go +++ /dev/null @@ -1,75 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package assert - -import ( - "errors" - "fmt" - "net/http" - "strings" -) - -// SecurityAuthorizationHeader verifies the request security Authorization -// header is present and has the expected HTTP Authorization scheme with a value -// if required. If a missing value or multiple values are found, it will -// return an error with a diagnostic text body and which should cause the -// handler to return immediately. -func SecurityAuthorizationHeader(req *http.Request, optional bool, httpAuthorizationScheme string) error { - values := req.Header.Values("Authorization") - - if len(values) == 0 { - if optional { - return nil - } - - return errors.New("missing expected Authorization header") - } - - if len(values) > 1 { - return fmt.Errorf("expected single Authorization header, got %d values", len(values)) - } - - got := values[0] - - if got == "" { - // Should return error, even if optional, as that represents an errant - // client implementation. - return errors.New("expected non-empty Authorization header") - } - - if httpAuthorizationScheme != "" && !strings.HasPrefix(got, httpAuthorizationScheme+" ") { - return fmt.Errorf("expected HTTP Authorization scheme %s, got: %s", httpAuthorizationScheme, got) - } - - return nil -} - -// SecurityHeader verifies the request security header name is present and has -// a value if required. If a missing value or multiple values are found, it will -// return an error with a diagnostic text body and which should cause the -// handler to return immediately. -func SecurityHeader(req *http.Request, name string, optional bool) error { - values := req.Header.Values(name) - - if len(values) == 0 { - if optional { - return nil - } - - return fmt.Errorf("missing expected security header %s", name) - } - - if len(values) > 1 { - return fmt.Errorf("expected single security header for %s, got %d values", name, len(values)) - } - - got := values[0] - - if got == "" { - // Should return error, even if optional, as that represents an errant - // client implementation. - return fmt.Errorf("expected non-empty security header %s", name) - } - - return nil -} diff --git a/tests/mockserver/internal/handler/doc.go b/tests/mockserver/internal/handler/doc.go deleted file mode 100644 index a4e60c89..00000000 --- a/tests/mockserver/internal/handler/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -// Package handlers contains all generated HTTP handlers for the server. They -// are listed via the generated GeneratedHandlers() function. -package handler diff --git a/tests/mockserver/internal/handler/generated_handler.go b/tests/mockserver/internal/handler/generated_handler.go deleted file mode 100644 index 929558ef..00000000 --- a/tests/mockserver/internal/handler/generated_handler.go +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package handler - -import ( - "context" - "net/http" -) - -// GeneratedHandler is the type that encapsulates a generated handler. -type GeneratedHandler struct { - // HTTP request handler function. - handlerFunc http.HandlerFunc - - // HTTP method, such as GET. - Method string - - // URL path, such as /path. - Path string -} - -// NewGeneratedHandler creates a generated handler via method, path, and handler -// function. -func NewGeneratedHandler(ctx context.Context, method string, path string, handlerFunc http.HandlerFunc) *GeneratedHandler { - return &GeneratedHandler{ - handlerFunc: handlerFunc, - Method: method, - Path: path, - } -} - -// HandlerFunc returns the underlying HTTP handler function. -func (h GeneratedHandler) HandlerFunc() http.HandlerFunc { - return h.handlerFunc -} diff --git a/tests/mockserver/internal/handler/generated_handlers.go b/tests/mockserver/internal/handler/generated_handlers.go deleted file mode 100644 index 83390871..00000000 --- a/tests/mockserver/internal/handler/generated_handlers.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package handler - -import ( - "context" - "mockserver/internal/logging" - "mockserver/internal/tracking" -) - -// GeneratedHandlers returns all generated handlers. -func GeneratedHandlers(ctx context.Context, dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) []*GeneratedHandler { - return []*GeneratedHandler{} -} diff --git a/tests/mockserver/internal/handler/values/files.go b/tests/mockserver/internal/handler/values/files.go deleted file mode 100644 index 6eca8858..00000000 --- a/tests/mockserver/internal/handler/values/files.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package values - -import ( - "io" - "os" -) - -func ReadFileToStream(fileName string) io.Reader { - s, err := os.Open(fileName) - if err != nil { - panic(err) - } - return s -} - -func ReadFileToBytes(fileName string) []byte { - data, err := os.ReadFile(fileName) - if err != nil { - panic(err) - } - return data -} - -func ReadFileToString(fileName string) string { - data, err := os.ReadFile(fileName) - if err != nil { - panic(err) - } - return string(data) -} - -func ReadBytes(r io.Reader) []byte { - data, err := io.ReadAll(r) - if err != nil { - panic(err) - } - return data -} diff --git a/tests/mockserver/internal/logging/doc.go b/tests/mockserver/internal/logging/doc.go deleted file mode 100644 index 8835f1cc..00000000 --- a/tests/mockserver/internal/logging/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -// Package logging contains the implementation and helpers for logging. -package logging diff --git a/tests/mockserver/internal/logging/formats.go b/tests/mockserver/internal/logging/formats.go deleted file mode 100644 index d6ab53c8..00000000 --- a/tests/mockserver/internal/logging/formats.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package logging - -import ( - "fmt" - "strings" -) - -const ( - // JSON log format. - FormatJSON = "JSON" - - // Plaintext log format. - FormatText = "text" - - // Default log format. - DefaultFormat = FormatText -) - -// Formats returns all supported formats. -func Formats() []string { - return []string{ - FormatJSON, - FormatText, - } -} - -func formatFromString(format string) (string, error) { - switch format { - case FormatJSON: - return format, nil - case FormatText: - return format, nil - default: - return "", fmt.Errorf("unsupported log format (%s), supported formats: %s", format, strings.Join(Formats(), ", ")) - } -} diff --git a/tests/mockserver/internal/logging/http_file.go b/tests/mockserver/internal/logging/http_file.go deleted file mode 100644 index d690d915..00000000 --- a/tests/mockserver/internal/logging/http_file.go +++ /dev/null @@ -1,310 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package logging - -import ( - "bufio" - "bytes" - "errors" - "fmt" - "io/fs" - "log" - "net/http" - "net/http/httptest" - "net/http/httputil" - "os" - "path/filepath" - "strconv" - "strings" - "sync" -) - -const ( - // DefaultHTTPFileDirectory is the default directory used for raw HTTP - // request and response files. - DefaultHTTPFileDirectory = "_debug" -) - -// HTTPFileDirectory is the directory where raw HTTP request and response files -// are written. -type HTTPFileDirectory struct { - // Filesystem at path. - filesystem fs.FS - - // Mapping of operations to call count. Used to sequentially increment file - // names and return current count. - operationCalls map[string]int64 - - // Mutex to protect operationCalls. - operationCallsMutex *sync.RWMutex - - // Absolute path to directory. - path string -} - -// NewHTTPFileDirectory will create a HTTPFileDirectory which exists and is a -// directory or will return an error. -func NewHTTPFileDirectory(explicitPath string) (*HTTPFileDirectory, error) { - path, err := filepath.Abs(DefaultHTTPFileDirectory) - if err != nil { - return nil, fmt.Errorf("error getting absolute path of HTTP file directory (%s): %w", DefaultHTTPFileDirectory, err) - } - - if explicitPath != "" { - absExplicitPath, err := filepath.Abs(explicitPath) - if err != nil { - return nil, fmt.Errorf("error getting absolute path of HTTP file directory (%s): %w", explicitPath, err) - } - - path = absExplicitPath - } - - result := &HTTPFileDirectory{ - filesystem: os.DirFS(path), - operationCalls: make(map[string]int64), - operationCallsMutex: new(sync.RWMutex), - path: path, - } - - fileInfo, err := os.Stat(path) - - if errors.Is(err, os.ErrNotExist) { - err := os.Mkdir(path, 0o2777) - if err != nil { - return nil, fmt.Errorf("error making HTTP file directory (%s): %w", path, err) - } - - return result, nil - } - - if err != nil { - return nil, fmt.Errorf("error reading HTTP file directory (%s): %w", path, err) - } - - if !fileInfo.IsDir() { - return nil, fmt.Errorf("error using HTTP file directory (%s): not a directory", path) - } - - return result, nil -} - -// Clean will remove all files from HTTPFileDirectory. -func (d *HTTPFileDirectory) Clean() error { - walkDirFunc := func(path string, entry fs.DirEntry, err error) error { - if err != nil { - return fmt.Errorf("error walking %s: %w", d.path, err) - } - - if path == "." { - return nil - } - - if entry.IsDir() { - return fs.SkipDir - } - - absPath := filepath.Join(d.path, path) - - err = os.Remove(absPath) - if err != nil { - return fmt.Errorf("error removing %s: %w", absPath, err) - } - - return nil - } - - return fs.WalkDir(d.filesystem, ".", walkDirFunc) -} - -// HandlerFunc is a HTTP handler that automatically writes the raw HTTP -// request and response to {path}/{operationId}_{call}_request and -// {path}/{operationId}_{call}_response files respectively. -func (d *HTTPFileDirectory) HandlerFunc(operationId string, next http.HandlerFunc) http.HandlerFunc { - return func(w http.ResponseWriter, req *http.Request) { - call := d.nextOperationCall(operationId) - - dump, err := httputil.DumpRequest(req, true) - if err != nil { - log.Printf("error dumping HTTP request: %s", err) - } - - if len(dump) > 0 { - requestPath := filepath.Join(d.path, d.operationCallRequestFilename(operationId, call)) - - err = os.WriteFile(requestPath, dump, 0o644) - if err != nil { - log.Printf("error writing HTTP request file (%s): %s", requestPath, err) - } - } - - recorder := httptest.NewRecorder() - - next(recorder, req) - - dump, err = httputil.DumpResponse(recorder.Result(), true) - if err != nil { - log.Printf("error dumping HTTP response: %s", err) - } - - if len(dump) > 0 { - responsePath := filepath.Join(d.path, d.operationCallResponseFilename(operationId, call)) - err = os.WriteFile(responsePath, dump, 0o644) - if err != nil { - log.Printf("error writing HTTP response file (%s): %s", responsePath, err) - } - } - - recorderToWriter(recorder, w) - } -} - -// Operation will return a new OASOperation from HTTPFileDirectory. -func (d *HTTPFileDirectory) Operation(operationId string) (*OASOperation, error) { - request, err := d.Request(operationId, 1) - if err != nil { - return nil, err - } - - result := NewOASOperation(d, operationId, request.Method, request.URL.Path) - - return result, nil -} - -// Operations will return all detected OASOperation from HTTPFileDirectory. -func (d *HTTPFileDirectory) Operations() ([]*OASOperation, error) { - var result []*OASOperation - - walkDirFunc := func(path string, entry fs.DirEntry, err error) error { - if err != nil { - return fmt.Errorf("error walking %s: %w", d.path, err) - } - - if !strings.HasSuffix(path, "_1_request") { - return nil - } - - operationId := strings.TrimSuffix(path, "_1_request") - operation, err := d.Operation(operationId) - if err != nil { - return err - } - - result = append(result, operation) - - return nil - } - - err := fs.WalkDir(d.filesystem, ".", walkDirFunc) - - return result, err -} - -// OperationCallCount will return the number of detected calls for an -// OASOperation. -func (d *HTTPFileDirectory) OperationCallCount(operationId string) int64 { - d.operationCallsMutex.RLock() - defer d.operationCallsMutex.RUnlock() - - result, ok := d.operationCalls[operationId] - - if ok { - return result - } - - return 0 -} - -// RawRequest returns the raw HTTP request contents as dumped by -// [httputil.DumpRequest]. -func (d *HTTPFileDirectory) RawRequest(operationId string, call int64) ([]byte, error) { - filename := d.operationCallRequestFilename(operationId, call) - file, err := fs.ReadFile(d.filesystem, filename) - if err != nil { - return nil, fmt.Errorf("error reading HTTP request file (%s): %w", filename, err) - } - - return file, nil -} - -// RawResponse returns the raw HTTP response contents as dumped by -// [httputil.DumpResponse]. -func (d *HTTPFileDirectory) RawResponse(operationId string, call int64) ([]byte, error) { - filename := d.operationCallResponseFilename(operationId, call) - file, err := fs.ReadFile(d.filesystem, d.operationCallResponseFilename(operationId, call)) - if err != nil { - return nil, fmt.Errorf("error reading HTTP response file (%s): %w", filename, err) - } - - return file, nil -} - -// Request returns the parsed HTTP request contents. -func (d *HTTPFileDirectory) Request(operationId string, call int64) (*http.Request, error) { - rawRequest, err := d.RawRequest(operationId, call) - if err != nil { - return nil, err - } - - result, err := http.ReadRequest(bufio.NewReader(bytes.NewReader(rawRequest))) - if err != nil { - return nil, fmt.Errorf("error converting HTTP request for operation %s call %d: %w", operationId, call, err) - } - - return result, nil -} - -// Response returns the parsed HTTP response contents. -func (d *HTTPFileDirectory) Response(operationId string, call int64) (*http.Response, error) { - rawResponse, err := d.RawResponse(operationId, call) - if err != nil { - return nil, err - } - - result, err := http.ReadResponse(bufio.NewReader(bytes.NewReader(rawResponse)), nil) - if err != nil { - return nil, fmt.Errorf("error converting HTTP response for operation %s call %d: %w", operationId, call, err) - } - - return result, nil -} - -// nextOperationCall returns the incremented call number for an operation. -func (d *HTTPFileDirectory) nextOperationCall(operationId string) int64 { - d.operationCallsMutex.Lock() - defer d.operationCallsMutex.Unlock() - - var result int64 - - priorCalls, ok := d.operationCalls[operationId] - - if ok { - result = priorCalls + 1 - } else { - // Start call counts at 1 for human consumption. - result = 1 - } - - d.operationCalls[operationId] = result - - return result -} - -// operationCallRequestFilename returns the raw HTTP request file name for the -// given operation and call. -func (d *HTTPFileDirectory) operationCallRequestFilename(operationId string, call int64) string { - return sanitizeOperationIdForFilename(operationId) + "_" + strconv.FormatInt(call, 10) + "_request" -} - -// operationCallResponseFilename returns the raw HTTP response file name for the -// given operation and call. -func (d *HTTPFileDirectory) operationCallResponseFilename(operationId string, call int64) string { - return sanitizeOperationIdForFilename(operationId) + "_" + strconv.FormatInt(call, 10) + "_response" -} - -func sanitizeOperationIdForFilename(operationId string) string { - operationId = strings.ReplaceAll(operationId, "{", "_") - operationId = strings.ReplaceAll(operationId, "}", "_") - operationId = strings.ReplaceAll(operationId, "/", "_") - operationId = strings.ReplaceAll(operationId, " ", "_") - return operationId -} diff --git a/tests/mockserver/internal/logging/http_logger.go b/tests/mockserver/internal/logging/http_logger.go deleted file mode 100644 index fdd5d058..00000000 --- a/tests/mockserver/internal/logging/http_logger.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package logging - -import ( - "context" - "fmt" - "log/slog" - "net/http" - "net/http/httptest" - "net/http/httputil" -) - -// HTTPLoggerHandler wraps another [http.Handler] with logging output using the -// provided logger. -func HTTPLoggerHandler(logger *slog.Logger, next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { - httpLogger := logger.WithGroup("http") - recorder := httptest.NewRecorder() - reqAttr := slog.Group( - "request", - slog.String("method", req.Method), - slog.String("url", req.URL.RequestURI()), - ) - - if !logger.Enabled(context.Background(), slog.LevelDebug) { - httpLogger.With(reqAttr).Info("received request") - next.ServeHTTP(recorder, req) - - resp := recorder.Result() - respAttr := slog.Group( - "response", - slog.String("status", resp.Status), - ) - - httpLogger.With(reqAttr).With(respAttr).Info("serving response") - - recorderToWriter(recorder, w) - - return - } - - dump, err := httputil.DumpRequest(req, true) - - if err != nil { - http.Error(w, fmt.Sprint(err), http.StatusInternalServerError) - - return - } - - rawReqAttr := slog.Group( - "request", - slog.String("method", req.Method), - slog.String("url", req.URL.RequestURI()), - slog.String("raw", string(dump)), - ) - - httpLogger.With(rawReqAttr).Debug("received request") - - next.ServeHTTP(recorder, req) - - dump, err = httputil.DumpResponse(recorder.Result(), true) - - if err != nil { - http.Error(w, fmt.Sprint(err), http.StatusInternalServerError) - - return - } - - rawRespAttr := slog.Group( - "response", - slog.String("raw", string(dump)), - ) - - // Intentionally use simpler request log attributes - httpLogger.With(reqAttr).With(rawRespAttr).Debug("serving response") - - recorderToWriter(recorder, w) - }) -} - -// recorderToWriter copies the recorded response back to the writer. -func recorderToWriter(recorder *httptest.ResponseRecorder, w http.ResponseWriter) { - for k, v := range recorder.Result().Header { - w.Header()[k] = v - } - - w.WriteHeader(recorder.Code) - _, _ = recorder.Body.WriteTo(w) -} diff --git a/tests/mockserver/internal/logging/levels.go b/tests/mockserver/internal/logging/levels.go deleted file mode 100644 index d2a8e93c..00000000 --- a/tests/mockserver/internal/logging/levels.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package logging - -import ( - "fmt" - "log/slog" - "strings" -) - -const ( - // Debug log level. - LevelDebug = "DEBUG" - - // Info log level. - LevelInfo = "INFO" - - // Warning log level. - LevelWarn = "WARN" - - // Error log level. - LevelError = "ERROR" - - // Default log level. - DefaultLevel = LevelInfo -) - -// Levels returns all supported levels. -func Levels() []string { - return []string{ - LevelDebug, - LevelInfo, - LevelWarn, - LevelError, - } -} - -func levelFromString(level string) (*slog.LevelVar, error) { - result := new(slog.LevelVar) - - switch strings.ToUpper(level) { - case "DEBUG": - result.Set(slog.LevelDebug) - case "INFO": - result.Set(slog.LevelInfo) - case "WARN": - result.Set(slog.LevelWarn) - case "ERROR": - result.Set(slog.LevelError) - default: - return nil, fmt.Errorf("unsupported log level (%s), supported levels: %s", level, strings.Join(Levels(), ", ")) - } - - return result, nil -} diff --git a/tests/mockserver/internal/logging/logger.go b/tests/mockserver/internal/logging/logger.go deleted file mode 100644 index bfd6dc78..00000000 --- a/tests/mockserver/internal/logging/logger.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package logging - -import ( - "fmt" - "io" - "log/slog" -) - -func NewLogger(w io.Writer, formatStr string, levelStr string) (*slog.Logger, error) { - level, err := levelFromString(levelStr) - - if err != nil { - return nil, err - } - - format, err := formatFromString(formatStr) - - if err != nil { - return nil, err - } - - handlerOpts := &slog.HandlerOptions{ - Level: level, - } - - var handler slog.Handler - - switch format { - case FormatJSON: - handler = slog.NewJSONHandler(w, handlerOpts) - case FormatText: - handler = slog.NewTextHandler(w, handlerOpts) - default: - return nil, fmt.Errorf("unimplemented format: %s", format) - } - - return slog.New(handler), nil -} diff --git a/tests/mockserver/internal/logging/oas_operation.go b/tests/mockserver/internal/logging/oas_operation.go deleted file mode 100644 index d4f2af7b..00000000 --- a/tests/mockserver/internal/logging/oas_operation.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package logging - -import "net/http" - -// OASOperation contains a singular OAS operation. An operation can have one or -// more calls. -type OASOperation struct { - // Underlying HTTP calls for the operation. - calls []*OASOperationCall - - // Directory that contains HTTP request and response logs. - dir *HTTPFileDirectory - - // Operation identifier as defined in OAS. - id string - - // HTTP method for the operation, such as GET. - method string - - // URL path for the operation, such as /path. - path string - - // TODO: Add group -} - -// NewOASOperation creates a new OASOperation. -func NewOASOperation(dir *HTTPFileDirectory, operationId string, method string, path string) *OASOperation { - operationCalls := dir.OperationCallCount(operationId) - result := &OASOperation{ - calls: make([]*OASOperationCall, 0, operationCalls), - dir: dir, - id: operationId, - method: method, - path: path, - } - - for i := range operationCalls { - // Start at 1 for human consumption. - result.calls = append(result.calls, NewOASOperationCall(result, i+1)) - } - - return result -} - -// CallCount returns the number of calls to an operation. -func (o *OASOperation) CallCount() int64 { - return int64(len(o.calls)) -} - -// Id returns the operation identifier as defined in OAS. -func (o *OASOperation) Id() string { - return o.id -} - -// Method returns the HTTP method for the operation, such as GET. -func (o *OASOperation) Method() string { - return o.method -} - -// Path returns the URL path for the operation, such as /path. -func (o *OASOperation) Path() string { - return o.path -} - -// RawRequest returns the raw HTTP request contents as dumped by -// [httputil.DumpRequest]. -func (o *OASOperation) RawRequest(call int64) ([]byte, error) { - return o.dir.RawRequest(o.id, call) -} - -// RawResponse returns the raw HTTP response contents as dumped by -// [httputil.DumpResponse]. -func (o *OASOperation) RawResponse(call int64) ([]byte, error) { - return o.dir.RawResponse(o.id, call) -} - -// Request returns the parsed HTTP request contents. -func (o *OASOperation) Request(call int64) (*http.Request, error) { - return o.dir.Request(o.id, call) -} - -// Response returns the parsed HTTP response contents. -func (o *OASOperation) Response(call int64) (*http.Response, error) { - return o.dir.Response(o.id, call) -} diff --git a/tests/mockserver/internal/logging/oas_operation_call.go b/tests/mockserver/internal/logging/oas_operation_call.go deleted file mode 100644 index beb05908..00000000 --- a/tests/mockserver/internal/logging/oas_operation_call.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package logging - -import ( - "bufio" - "bytes" - "net/http" -) - -// OASOperationCall contains a singular OAS operation HTTP call. -type OASOperationCall struct { - // The HTTP call number, as determined by the HTTP server. Starts at 1 and - // incremented. - call int64 - - // The associated OAS operation to this call. - operation *OASOperation - - // Parsed HTTP request contents. Cached on first use. - request *http.Request - - // Raw HTTP request contents. Cached on first use. - requestRaw []byte - - // Parsed HTTP response contents. Cached on first use. - response *http.Response - - // Raw HTTP response contents. Cached on first use. - responseRaw []byte - - // TODO: Add test identifier -} - -// NewOASOperationCall creates a new OASOperationCall. -func NewOASOperationCall(operation *OASOperation, call int64) *OASOperationCall { - return &OASOperationCall{ - call: call, - operation: operation, - } -} - -// RawRequest returns the raw HTTP request contents as dumped by -// [httputil.DumpRequest]. -func (c *OASOperationCall) RawRequest() ([]byte, error) { - if c.requestRaw != nil { - return c.requestRaw, nil - } - - requestRaw, err := c.operation.RawRequest(c.call) - - if err != nil { - return nil, err - } - - c.requestRaw = requestRaw - - return c.requestRaw, nil -} - -// RawResponse returns the raw HTTP response contents as dumped by -// [httputil.DumpResponse]. -func (c *OASOperationCall) RawResponse() ([]byte, error) { - if c.responseRaw != nil { - return c.responseRaw, nil - } - - responseRaw, err := c.operation.RawResponse(c.call) - - if err != nil { - return nil, err - } - - c.responseRaw = responseRaw - - return c.responseRaw, nil -} - -// Request returns the parsed HTTP request contents. -func (c *OASOperationCall) Request() (*http.Request, error) { - if c.request != nil { - return c.request, nil - } - - requestRaw, err := c.RawRequest() - - if err != nil { - return nil, err - } - - request, err := http.ReadRequest(bufio.NewReader(bytes.NewReader(requestRaw))) - - if err != nil { - return nil, err - } - - c.request = request - - return c.request, nil -} - -// Response returns the parsed HTTP response contents. -func (c *OASOperationCall) Response() (*http.Response, error) { - if c.response != nil { - return c.response, nil - } - - responseRaw, err := c.RawResponse() - - if err != nil { - return nil, err - } - - response, err := http.ReadResponse(bufio.NewReader(bytes.NewReader(responseRaw)), nil) - - if err != nil { - return nil, err - } - - c.response = response - - return c.response, nil -} diff --git a/tests/mockserver/internal/sdk/models/components/accountingdepartment.go b/tests/mockserver/internal/sdk/models/components/accountingdepartment.go deleted file mode 100644 index b736269b..00000000 --- a/tests/mockserver/internal/sdk/models/components/accountingdepartment.go +++ /dev/null @@ -1,232 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// DepartmentStatus - Based on the status some functionality is enabled or disabled. -type DepartmentStatus string - -const ( - DepartmentStatusActive DepartmentStatus = "active" - DepartmentStatusInactive DepartmentStatus = "inactive" -) - -func (e DepartmentStatus) ToPointer() *DepartmentStatus { - return &e -} -func (e *DepartmentStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "active": - fallthrough - case "inactive": - *e = DepartmentStatus(v) - return nil - default: - return fmt.Errorf("invalid value for DepartmentStatus: %v", v) - } -} - -type AccountingDepartment struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // A unique identifier for an object. - ParentID *string `json:"parent_id,omitempty"` - // The name of the department. - Name *string `json:"name,omitempty"` - // Based on the status some functionality is enabled or disabled. - Status *DepartmentStatus `json:"status,omitempty"` - Subsidiaries []SubsidiaryReference `json:"subsidiaries,omitempty"` - // The code of the department. - Code *string `json:"code,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (a AccountingDepartment) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingDepartment) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingDepartment) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *AccountingDepartment) GetParentID() *string { - if o == nil { - return nil - } - return o.ParentID -} - -func (o *AccountingDepartment) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *AccountingDepartment) GetStatus() *DepartmentStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *AccountingDepartment) GetSubsidiaries() []SubsidiaryReference { - if o == nil { - return nil - } - return o.Subsidiaries -} - -func (o *AccountingDepartment) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *AccountingDepartment) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *AccountingDepartment) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *AccountingDepartment) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *AccountingDepartment) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *AccountingDepartment) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *AccountingDepartment) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *AccountingDepartment) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type AccountingDepartmentInput struct { - // A unique identifier for an object. - ParentID *string `json:"parent_id,omitempty"` - // The name of the department. - Name *string `json:"name,omitempty"` - // Based on the status some functionality is enabled or disabled. - Status *DepartmentStatus `json:"status,omitempty"` - Subsidiaries []SubsidiaryReferenceInput `json:"subsidiaries,omitempty"` - // The code of the department. - Code *string `json:"code,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *AccountingDepartmentInput) GetParentID() *string { - if o == nil { - return nil - } - return o.ParentID -} - -func (o *AccountingDepartmentInput) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *AccountingDepartmentInput) GetStatus() *DepartmentStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *AccountingDepartmentInput) GetSubsidiaries() []SubsidiaryReferenceInput { - if o == nil { - return nil - } - return o.Subsidiaries -} - -func (o *AccountingDepartmentInput) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *AccountingDepartmentInput) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *AccountingDepartmentInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/accountingdepartmentsfilter.go b/tests/mockserver/internal/sdk/models/components/accountingdepartmentsfilter.go deleted file mode 100644 index a61afc32..00000000 --- a/tests/mockserver/internal/sdk/models/components/accountingdepartmentsfilter.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type AccountingDepartmentsFilter struct { - // Id of the subsidiary to search for - Subsidiary *string `queryParam:"name=subsidiary"` -} - -func (o *AccountingDepartmentsFilter) GetSubsidiary() *string { - if o == nil { - return nil - } - return o.Subsidiary -} diff --git a/tests/mockserver/internal/sdk/models/components/accountinglocation.go b/tests/mockserver/internal/sdk/models/components/accountinglocation.go deleted file mode 100644 index 3322585c..00000000 --- a/tests/mockserver/internal/sdk/models/components/accountinglocation.go +++ /dev/null @@ -1,248 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// LocationStatus - Based on the status some functionality is enabled or disabled. -type LocationStatus string - -const ( - LocationStatusActive LocationStatus = "active" - LocationStatusInactive LocationStatus = "inactive" -) - -func (e LocationStatus) ToPointer() *LocationStatus { - return &e -} -func (e *LocationStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "active": - fallthrough - case "inactive": - *e = LocationStatus(v) - return nil - default: - return fmt.Errorf("invalid value for LocationStatus: %v", v) - } -} - -type AccountingLocation struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // A unique identifier for an object. - ParentID *string `json:"parent_id,omitempty"` - // The name of the company. - CompanyName *string `json:"company_name,omitempty"` - // The display name of the location. - DisplayName *string `json:"display_name,omitempty"` - // Based on the status some functionality is enabled or disabled. - Status *LocationStatus `json:"status,omitempty"` - Addresses []Address `json:"addresses,omitempty"` - Subsidiaries []SubsidiaryReference `json:"subsidiaries,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (a AccountingLocation) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingLocation) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingLocation) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *AccountingLocation) GetParentID() *string { - if o == nil { - return nil - } - return o.ParentID -} - -func (o *AccountingLocation) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *AccountingLocation) GetDisplayName() *string { - if o == nil { - return nil - } - return o.DisplayName -} - -func (o *AccountingLocation) GetStatus() *LocationStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *AccountingLocation) GetAddresses() []Address { - if o == nil { - return nil - } - return o.Addresses -} - -func (o *AccountingLocation) GetSubsidiaries() []SubsidiaryReference { - if o == nil { - return nil - } - return o.Subsidiaries -} - -func (o *AccountingLocation) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *AccountingLocation) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *AccountingLocation) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *AccountingLocation) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *AccountingLocation) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *AccountingLocation) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *AccountingLocation) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type AccountingLocationInput struct { - // A unique identifier for an object. - ParentID *string `json:"parent_id,omitempty"` - // The name of the company. - CompanyName *string `json:"company_name,omitempty"` - // The display name of the location. - DisplayName *string `json:"display_name,omitempty"` - // Based on the status some functionality is enabled or disabled. - Status *LocationStatus `json:"status,omitempty"` - Addresses []Address `json:"addresses,omitempty"` - Subsidiaries []SubsidiaryReferenceInput `json:"subsidiaries,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *AccountingLocationInput) GetParentID() *string { - if o == nil { - return nil - } - return o.ParentID -} - -func (o *AccountingLocationInput) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *AccountingLocationInput) GetDisplayName() *string { - if o == nil { - return nil - } - return o.DisplayName -} - -func (o *AccountingLocationInput) GetStatus() *LocationStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *AccountingLocationInput) GetAddresses() []Address { - if o == nil { - return nil - } - return o.Addresses -} - -func (o *AccountingLocationInput) GetSubsidiaries() []SubsidiaryReferenceInput { - if o == nil { - return nil - } - return o.Subsidiaries -} - -func (o *AccountingLocationInput) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *AccountingLocationInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/accountinglocationsfilter.go b/tests/mockserver/internal/sdk/models/components/accountinglocationsfilter.go deleted file mode 100644 index 114d1b81..00000000 --- a/tests/mockserver/internal/sdk/models/components/accountinglocationsfilter.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type AccountingLocationsFilter struct { - // Id of the subsidiary to search for - Subsidiary *string `queryParam:"name=subsidiary"` -} - -func (o *AccountingLocationsFilter) GetSubsidiary() *string { - if o == nil { - return nil - } - return o.Subsidiary -} diff --git a/tests/mockserver/internal/sdk/models/components/activitiesfilter.go b/tests/mockserver/internal/sdk/models/components/activitiesfilter.go deleted file mode 100644 index d377b985..00000000 --- a/tests/mockserver/internal/sdk/models/components/activitiesfilter.go +++ /dev/null @@ -1,66 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type ActivitiesFilter struct { - // Company ID to filter on - CompanyID *string `queryParam:"name=company_id"` - // Owner ID to filter on - OwnerID *string `queryParam:"name=owner_id"` - // Primary contact ID to filter on - ContactID *string `queryParam:"name=contact_id"` - UpdatedSince *time.Time `queryParam:"name=updated_since"` - // Type to filter on - Type *string `queryParam:"name=type"` -} - -func (a ActivitiesFilter) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *ActivitiesFilter) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ActivitiesFilter) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *ActivitiesFilter) GetOwnerID() *string { - if o == nil { - return nil - } - return o.OwnerID -} - -func (o *ActivitiesFilter) GetContactID() *string { - if o == nil { - return nil - } - return o.ContactID -} - -func (o *ActivitiesFilter) GetUpdatedSince() *time.Time { - if o == nil { - return nil - } - return o.UpdatedSince -} - -func (o *ActivitiesFilter) GetType() *string { - if o == nil { - return nil - } - return o.Type -} diff --git a/tests/mockserver/internal/sdk/models/components/activitiessort.go b/tests/mockserver/internal/sdk/models/components/activitiessort.go deleted file mode 100644 index 2eaea916..00000000 --- a/tests/mockserver/internal/sdk/models/components/activitiessort.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// ActivitiesSortBy - The field on which to sort the Activities -type ActivitiesSortBy string - -const ( - ActivitiesSortByCreatedAt ActivitiesSortBy = "created_at" - ActivitiesSortByUpdatedAt ActivitiesSortBy = "updated_at" -) - -func (e ActivitiesSortBy) ToPointer() *ActivitiesSortBy { - return &e -} -func (e *ActivitiesSortBy) 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 = ActivitiesSortBy(v) - return nil - default: - return fmt.Errorf("invalid value for ActivitiesSortBy: %v", v) - } -} - -type ActivitiesSort struct { - // The field on which to sort the Activities - By *ActivitiesSortBy `queryParam:"name=by"` - // The direction in which to sort the results - Direction *SortDirection `default:"asc" queryParam:"name=direction"` -} - -func (a ActivitiesSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *ActivitiesSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ActivitiesSort) GetBy() *ActivitiesSortBy { - if o == nil { - return nil - } - return o.By -} - -func (o *ActivitiesSort) GetDirection() *SortDirection { - if o == nil { - return nil - } - return o.Direction -} diff --git a/tests/mockserver/internal/sdk/models/components/activity.go b/tests/mockserver/internal/sdk/models/components/activity.go deleted file mode 100644 index 93a3d8a9..00000000 --- a/tests/mockserver/internal/sdk/models/components/activity.go +++ /dev/null @@ -1,946 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// ActivityType - The type of the activity -type ActivityType string - -const ( - ActivityTypeCall ActivityType = "call" - ActivityTypeMeeting ActivityType = "meeting" - ActivityTypeEmail ActivityType = "email" - ActivityTypeNote ActivityType = "note" - ActivityTypeTask ActivityType = "task" - ActivityTypeDeadline ActivityType = "deadline" - ActivityTypeSendLetter ActivityType = "send-letter" - ActivityTypeSendQuote ActivityType = "send-quote" - ActivityTypeOther ActivityType = "other" -) - -func (e ActivityType) ToPointer() *ActivityType { - return &e -} -func (e *ActivityType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "call": - fallthrough - case "meeting": - fallthrough - case "email": - fallthrough - case "note": - fallthrough - case "task": - fallthrough - case "deadline": - fallthrough - case "send-letter": - fallthrough - case "send-quote": - fallthrough - case "other": - *e = ActivityType(v) - return nil - default: - return fmt.Errorf("invalid value for ActivityType: %v", v) - } -} - -type ShowAs string - -const ( - ShowAsFree ShowAs = "free" - ShowAsBusy ShowAs = "busy" -) - -func (e ShowAs) ToPointer() *ShowAs { - return &e -} -func (e *ShowAs) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "free": - fallthrough - case "busy": - *e = ShowAs(v) - return nil - default: - return fmt.Errorf("invalid value for ShowAs: %v", v) - } -} - -type Activity struct { - // The unique identifier of the activity - ID *string `json:"id,omitempty"` - // The third-party API ID of original entity - DownstreamID *string `json:"downstream_id,omitempty"` - // The date and time of the activity - ActivityDatetime *string `json:"activity_datetime,omitempty"` - // The duration of the activity in seconds - DurationSeconds *int64 `json:"duration_seconds,omitempty"` - // The user related to the activity - UserID *string `json:"user_id,omitempty"` - // The account related to the activity - AccountID *string `json:"account_id,omitempty"` - // The contact related to the activity - ContactID *string `json:"contact_id,omitempty"` - // The company related to the activity - CompanyID *string `json:"company_id,omitempty"` - // The opportunity related to the activity - OpportunityID *string `json:"opportunity_id,omitempty"` - // The lead related to the activity - LeadID *string `json:"lead_id,omitempty"` - // The owner of the activity - OwnerID *string `json:"owner_id,omitempty"` - // The campaign related to the activity - CampaignID *string `json:"campaign_id,omitempty"` - // The case related to the activity - CaseID *string `json:"case_id,omitempty"` - // The asset related to the activity - AssetID *string `json:"asset_id,omitempty"` - // The contract related to the activity - ContractID *string `json:"contract_id,omitempty"` - // The product related to the activity - ProductID *string `json:"product_id,omitempty"` - // The solution related to the activity - SolutionID *string `json:"solution_id,omitempty"` - // The custom object related to the activity - CustomObjectID *string `json:"custom_object_id,omitempty"` - // The type of the activity - Type *ActivityType `json:"type"` - // The title of the activity - Title *string `json:"title,omitempty"` - // A description of the activity - Description *string `json:"description,omitempty"` - // An internal note about the activity - Note *string `json:"note,omitempty"` - // The location of the activity - Location *string `json:"location,omitempty"` - LocationAddress *Address `json:"location_address,omitempty"` - // Whether the Activity is an all day event or not - AllDayEvent *bool `json:"all_day_event,omitempty"` - // Whether the Activity is private or not - Private *bool `json:"private,omitempty"` - // Whether the Activity is a group event or not - GroupEvent *bool `json:"group_event,omitempty"` - // The sub type of the group event - EventSubType *string `json:"event_sub_type,omitempty"` - // The type of the group event - GroupEventType *string `json:"group_event_type,omitempty"` - // Whether the activity is a child of another activity or not - Child *bool `json:"child,omitempty"` - // Whether the activity is archived or not - Archived *bool `json:"archived,omitempty"` - // Whether the activity is deleted or not - Deleted *bool `json:"deleted,omitempty"` - ShowAs *ShowAs `json:"show_as,omitempty"` - // Whether the Activity is done or not - Done *bool `json:"done,omitempty"` - // The start date and time of the activity - StartDatetime *string `json:"start_datetime,omitempty"` - // The end date and time of the activity - EndDatetime *string `json:"end_datetime,omitempty"` - // The duration of the activity in minutes - DurationMinutes *int64 `json:"duration_minutes,omitempty"` - // The date of the activity - ActivityDate *string `json:"activity_date,omitempty"` - // The end date of the activity - EndDate *string `json:"end_date,omitempty"` - // Whether the activity is recurrent or not - Recurrent *bool `json:"recurrent,omitempty"` - // The date and time of the reminder - ReminderDatetime *string `json:"reminder_datetime,omitempty"` - // Whether the reminder is set or not - ReminderSet *bool `json:"reminder_set,omitempty"` - // The URL of the video conference - VideoConferenceURL *string `json:"video_conference_url,omitempty"` - // The ID of the video conference - VideoConferenceID *string `json:"video_conference_id,omitempty"` - // Custom fields of the activity - CustomFields []CustomField `json:"custom_fields,omitempty"` - Attendees []ActivityAttendee `json:"attendees,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // The user who last updated the activity - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the activity - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the activity was last updated - UpdatedAt *string `json:"updated_at,omitempty"` - // The date and time when the activity was created - CreatedAt *string `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *Activity) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Activity) GetDownstreamID() *string { - if o == nil { - return nil - } - return o.DownstreamID -} - -func (o *Activity) GetActivityDatetime() *string { - if o == nil { - return nil - } - return o.ActivityDatetime -} - -func (o *Activity) GetDurationSeconds() *int64 { - if o == nil { - return nil - } - return o.DurationSeconds -} - -func (o *Activity) GetUserID() *string { - if o == nil { - return nil - } - return o.UserID -} - -func (o *Activity) GetAccountID() *string { - if o == nil { - return nil - } - return o.AccountID -} - -func (o *Activity) GetContactID() *string { - if o == nil { - return nil - } - return o.ContactID -} - -func (o *Activity) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *Activity) GetOpportunityID() *string { - if o == nil { - return nil - } - return o.OpportunityID -} - -func (o *Activity) GetLeadID() *string { - if o == nil { - return nil - } - return o.LeadID -} - -func (o *Activity) GetOwnerID() *string { - if o == nil { - return nil - } - return o.OwnerID -} - -func (o *Activity) GetCampaignID() *string { - if o == nil { - return nil - } - return o.CampaignID -} - -func (o *Activity) GetCaseID() *string { - if o == nil { - return nil - } - return o.CaseID -} - -func (o *Activity) GetAssetID() *string { - if o == nil { - return nil - } - return o.AssetID -} - -func (o *Activity) GetContractID() *string { - if o == nil { - return nil - } - return o.ContractID -} - -func (o *Activity) GetProductID() *string { - if o == nil { - return nil - } - return o.ProductID -} - -func (o *Activity) GetSolutionID() *string { - if o == nil { - return nil - } - return o.SolutionID -} - -func (o *Activity) GetCustomObjectID() *string { - if o == nil { - return nil - } - return o.CustomObjectID -} - -func (o *Activity) GetType() *ActivityType { - if o == nil { - return nil - } - return o.Type -} - -func (o *Activity) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *Activity) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *Activity) GetNote() *string { - if o == nil { - return nil - } - return o.Note -} - -func (o *Activity) GetLocation() *string { - if o == nil { - return nil - } - return o.Location -} - -func (o *Activity) GetLocationAddress() *Address { - if o == nil { - return nil - } - return o.LocationAddress -} - -func (o *Activity) GetAllDayEvent() *bool { - if o == nil { - return nil - } - return o.AllDayEvent -} - -func (o *Activity) GetPrivate() *bool { - if o == nil { - return nil - } - return o.Private -} - -func (o *Activity) GetGroupEvent() *bool { - if o == nil { - return nil - } - return o.GroupEvent -} - -func (o *Activity) GetEventSubType() *string { - if o == nil { - return nil - } - return o.EventSubType -} - -func (o *Activity) GetGroupEventType() *string { - if o == nil { - return nil - } - return o.GroupEventType -} - -func (o *Activity) GetChild() *bool { - if o == nil { - return nil - } - return o.Child -} - -func (o *Activity) GetArchived() *bool { - if o == nil { - return nil - } - return o.Archived -} - -func (o *Activity) GetDeleted() *bool { - if o == nil { - return nil - } - return o.Deleted -} - -func (o *Activity) GetShowAs() *ShowAs { - if o == nil { - return nil - } - return o.ShowAs -} - -func (o *Activity) GetDone() *bool { - if o == nil { - return nil - } - return o.Done -} - -func (o *Activity) GetStartDatetime() *string { - if o == nil { - return nil - } - return o.StartDatetime -} - -func (o *Activity) GetEndDatetime() *string { - if o == nil { - return nil - } - return o.EndDatetime -} - -func (o *Activity) GetDurationMinutes() *int64 { - if o == nil { - return nil - } - return o.DurationMinutes -} - -func (o *Activity) GetActivityDate() *string { - if o == nil { - return nil - } - return o.ActivityDate -} - -func (o *Activity) GetEndDate() *string { - if o == nil { - return nil - } - return o.EndDate -} - -func (o *Activity) GetRecurrent() *bool { - if o == nil { - return nil - } - return o.Recurrent -} - -func (o *Activity) GetReminderDatetime() *string { - if o == nil { - return nil - } - return o.ReminderDatetime -} - -func (o *Activity) GetReminderSet() *bool { - if o == nil { - return nil - } - return o.ReminderSet -} - -func (o *Activity) GetVideoConferenceURL() *string { - if o == nil { - return nil - } - return o.VideoConferenceURL -} - -func (o *Activity) GetVideoConferenceID() *string { - if o == nil { - return nil - } - return o.VideoConferenceID -} - -func (o *Activity) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *Activity) GetAttendees() []ActivityAttendee { - if o == nil { - return nil - } - return o.Attendees -} - -func (o *Activity) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Activity) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *Activity) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *Activity) GetUpdatedAt() *string { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Activity) GetCreatedAt() *string { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Activity) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type ActivityInput struct { - // The date and time of the activity - ActivityDatetime *string `json:"activity_datetime,omitempty"` - // The duration of the activity in seconds - DurationSeconds *int64 `json:"duration_seconds,omitempty"` - // The user related to the activity - UserID *string `json:"user_id,omitempty"` - // The account related to the activity - AccountID *string `json:"account_id,omitempty"` - // The contact related to the activity - ContactID *string `json:"contact_id,omitempty"` - // The company related to the activity - CompanyID *string `json:"company_id,omitempty"` - // The opportunity related to the activity - OpportunityID *string `json:"opportunity_id,omitempty"` - // The lead related to the activity - LeadID *string `json:"lead_id,omitempty"` - // The owner of the activity - OwnerID *string `json:"owner_id,omitempty"` - // The campaign related to the activity - CampaignID *string `json:"campaign_id,omitempty"` - // The case related to the activity - CaseID *string `json:"case_id,omitempty"` - // The asset related to the activity - AssetID *string `json:"asset_id,omitempty"` - // The contract related to the activity - ContractID *string `json:"contract_id,omitempty"` - // The product related to the activity - ProductID *string `json:"product_id,omitempty"` - // The solution related to the activity - SolutionID *string `json:"solution_id,omitempty"` - // The custom object related to the activity - CustomObjectID *string `json:"custom_object_id,omitempty"` - // The type of the activity - Type *ActivityType `json:"type"` - // The title of the activity - Title *string `json:"title,omitempty"` - // A description of the activity - Description *string `json:"description,omitempty"` - // An internal note about the activity - Note *string `json:"note,omitempty"` - // The location of the activity - Location *string `json:"location,omitempty"` - LocationAddress *Address `json:"location_address,omitempty"` - // Whether the Activity is an all day event or not - AllDayEvent *bool `json:"all_day_event,omitempty"` - // Whether the Activity is private or not - Private *bool `json:"private,omitempty"` - // Whether the Activity is a group event or not - GroupEvent *bool `json:"group_event,omitempty"` - // The sub type of the group event - EventSubType *string `json:"event_sub_type,omitempty"` - // The type of the group event - GroupEventType *string `json:"group_event_type,omitempty"` - // Whether the activity is a child of another activity or not - Child *bool `json:"child,omitempty"` - // Whether the activity is archived or not - Archived *bool `json:"archived,omitempty"` - // Whether the activity is deleted or not - Deleted *bool `json:"deleted,omitempty"` - ShowAs *ShowAs `json:"show_as,omitempty"` - // Whether the Activity is done or not - Done *bool `json:"done,omitempty"` - // The start date and time of the activity - StartDatetime *string `json:"start_datetime,omitempty"` - // The end date and time of the activity - EndDatetime *string `json:"end_datetime,omitempty"` - // The date of the activity - ActivityDate *string `json:"activity_date,omitempty"` - // The end date of the activity - EndDate *string `json:"end_date,omitempty"` - // Whether the activity is recurrent or not - Recurrent *bool `json:"recurrent,omitempty"` - // The date and time of the reminder - ReminderDatetime *string `json:"reminder_datetime,omitempty"` - // Whether the reminder is set or not - ReminderSet *bool `json:"reminder_set,omitempty"` - // The URL of the video conference - VideoConferenceURL *string `json:"video_conference_url,omitempty"` - // The ID of the video conference - VideoConferenceID *string `json:"video_conference_id,omitempty"` - // Custom fields of the activity - CustomFields []CustomField `json:"custom_fields,omitempty"` - Attendees []ActivityAttendeeInput `json:"attendees,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *ActivityInput) GetActivityDatetime() *string { - if o == nil { - return nil - } - return o.ActivityDatetime -} - -func (o *ActivityInput) GetDurationSeconds() *int64 { - if o == nil { - return nil - } - return o.DurationSeconds -} - -func (o *ActivityInput) GetUserID() *string { - if o == nil { - return nil - } - return o.UserID -} - -func (o *ActivityInput) GetAccountID() *string { - if o == nil { - return nil - } - return o.AccountID -} - -func (o *ActivityInput) GetContactID() *string { - if o == nil { - return nil - } - return o.ContactID -} - -func (o *ActivityInput) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *ActivityInput) GetOpportunityID() *string { - if o == nil { - return nil - } - return o.OpportunityID -} - -func (o *ActivityInput) GetLeadID() *string { - if o == nil { - return nil - } - return o.LeadID -} - -func (o *ActivityInput) GetOwnerID() *string { - if o == nil { - return nil - } - return o.OwnerID -} - -func (o *ActivityInput) GetCampaignID() *string { - if o == nil { - return nil - } - return o.CampaignID -} - -func (o *ActivityInput) GetCaseID() *string { - if o == nil { - return nil - } - return o.CaseID -} - -func (o *ActivityInput) GetAssetID() *string { - if o == nil { - return nil - } - return o.AssetID -} - -func (o *ActivityInput) GetContractID() *string { - if o == nil { - return nil - } - return o.ContractID -} - -func (o *ActivityInput) GetProductID() *string { - if o == nil { - return nil - } - return o.ProductID -} - -func (o *ActivityInput) GetSolutionID() *string { - if o == nil { - return nil - } - return o.SolutionID -} - -func (o *ActivityInput) GetCustomObjectID() *string { - if o == nil { - return nil - } - return o.CustomObjectID -} - -func (o *ActivityInput) GetType() *ActivityType { - if o == nil { - return nil - } - return o.Type -} - -func (o *ActivityInput) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *ActivityInput) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *ActivityInput) GetNote() *string { - if o == nil { - return nil - } - return o.Note -} - -func (o *ActivityInput) GetLocation() *string { - if o == nil { - return nil - } - return o.Location -} - -func (o *ActivityInput) GetLocationAddress() *Address { - if o == nil { - return nil - } - return o.LocationAddress -} - -func (o *ActivityInput) GetAllDayEvent() *bool { - if o == nil { - return nil - } - return o.AllDayEvent -} - -func (o *ActivityInput) GetPrivate() *bool { - if o == nil { - return nil - } - return o.Private -} - -func (o *ActivityInput) GetGroupEvent() *bool { - if o == nil { - return nil - } - return o.GroupEvent -} - -func (o *ActivityInput) GetEventSubType() *string { - if o == nil { - return nil - } - return o.EventSubType -} - -func (o *ActivityInput) GetGroupEventType() *string { - if o == nil { - return nil - } - return o.GroupEventType -} - -func (o *ActivityInput) GetChild() *bool { - if o == nil { - return nil - } - return o.Child -} - -func (o *ActivityInput) GetArchived() *bool { - if o == nil { - return nil - } - return o.Archived -} - -func (o *ActivityInput) GetDeleted() *bool { - if o == nil { - return nil - } - return o.Deleted -} - -func (o *ActivityInput) GetShowAs() *ShowAs { - if o == nil { - return nil - } - return o.ShowAs -} - -func (o *ActivityInput) GetDone() *bool { - if o == nil { - return nil - } - return o.Done -} - -func (o *ActivityInput) GetStartDatetime() *string { - if o == nil { - return nil - } - return o.StartDatetime -} - -func (o *ActivityInput) GetEndDatetime() *string { - if o == nil { - return nil - } - return o.EndDatetime -} - -func (o *ActivityInput) GetActivityDate() *string { - if o == nil { - return nil - } - return o.ActivityDate -} - -func (o *ActivityInput) GetEndDate() *string { - if o == nil { - return nil - } - return o.EndDate -} - -func (o *ActivityInput) GetRecurrent() *bool { - if o == nil { - return nil - } - return o.Recurrent -} - -func (o *ActivityInput) GetReminderDatetime() *string { - if o == nil { - return nil - } - return o.ReminderDatetime -} - -func (o *ActivityInput) GetReminderSet() *bool { - if o == nil { - return nil - } - return o.ReminderSet -} - -func (o *ActivityInput) GetVideoConferenceURL() *string { - if o == nil { - return nil - } - return o.VideoConferenceURL -} - -func (o *ActivityInput) GetVideoConferenceID() *string { - if o == nil { - return nil - } - return o.VideoConferenceID -} - -func (o *ActivityInput) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *ActivityInput) GetAttendees() []ActivityAttendeeInput { - if o == nil { - return nil - } - return o.Attendees -} - -func (o *ActivityInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/activityattendee.go b/tests/mockserver/internal/sdk/models/components/activityattendee.go deleted file mode 100644 index 6580eb69..00000000 --- a/tests/mockserver/internal/sdk/models/components/activityattendee.go +++ /dev/null @@ -1,264 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// ActivityAttendeeStatus - Status of the attendee -type ActivityAttendeeStatus string - -const ( - ActivityAttendeeStatusAccepted ActivityAttendeeStatus = "accepted" - ActivityAttendeeStatusTentative ActivityAttendeeStatus = "tentative" - ActivityAttendeeStatusDeclined ActivityAttendeeStatus = "declined" -) - -func (e ActivityAttendeeStatus) ToPointer() *ActivityAttendeeStatus { - return &e -} -func (e *ActivityAttendeeStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "accepted": - fallthrough - case "tentative": - fallthrough - case "declined": - *e = ActivityAttendeeStatus(v) - return nil - default: - return fmt.Errorf("invalid value for ActivityAttendeeStatus: %v", v) - } -} - -type ActivityAttendee struct { - // Unique identifier for the attendee - ID *string `json:"id,omitempty"` - // Full name of the attendee - Name *string `json:"name,omitempty"` - // First name of the attendee - FirstName *string `json:"first_name,omitempty"` - // Middle name of the attendee - MiddleName *string `json:"middle_name,omitempty"` - // Last name of the attendee - LastName *string `json:"last_name,omitempty"` - // Prefix of the attendee - Prefix *string `json:"prefix,omitempty"` - // Suffix of the attendee - Suffix *string `json:"suffix,omitempty"` - // Email address of the attendee - EmailAddress *string `json:"email_address,omitempty"` - // Whether the attendee is the organizer of the activity - IsOrganizer *bool `json:"is_organizer,omitempty"` - // Status of the attendee - Status *ActivityAttendeeStatus `json:"status,omitempty"` - // The identifier for a related user - UserID *string `json:"user_id,omitempty"` - // The identifier for a related contact - ContactID *string `json:"contact_id,omitempty"` - // The last time the attendee was updated (ISO 8601) - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The time the attendee was created (ISO 8601) - CreatedAt *time.Time `json:"created_at,omitempty"` -} - -func (a ActivityAttendee) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *ActivityAttendee) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ActivityAttendee) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *ActivityAttendee) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *ActivityAttendee) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *ActivityAttendee) GetMiddleName() *string { - if o == nil { - return nil - } - return o.MiddleName -} - -func (o *ActivityAttendee) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *ActivityAttendee) GetPrefix() *string { - if o == nil { - return nil - } - return o.Prefix -} - -func (o *ActivityAttendee) GetSuffix() *string { - if o == nil { - return nil - } - return o.Suffix -} - -func (o *ActivityAttendee) GetEmailAddress() *string { - if o == nil { - return nil - } - return o.EmailAddress -} - -func (o *ActivityAttendee) GetIsOrganizer() *bool { - if o == nil { - return nil - } - return o.IsOrganizer -} - -func (o *ActivityAttendee) GetStatus() *ActivityAttendeeStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *ActivityAttendee) GetUserID() *string { - if o == nil { - return nil - } - return o.UserID -} - -func (o *ActivityAttendee) GetContactID() *string { - if o == nil { - return nil - } - return o.ContactID -} - -func (o *ActivityAttendee) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *ActivityAttendee) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -type ActivityAttendeeInput struct { - // Full name of the attendee - Name *string `json:"name,omitempty"` - // First name of the attendee - FirstName *string `json:"first_name,omitempty"` - // Middle name of the attendee - MiddleName *string `json:"middle_name,omitempty"` - // Last name of the attendee - LastName *string `json:"last_name,omitempty"` - // Prefix of the attendee - Prefix *string `json:"prefix,omitempty"` - // Suffix of the attendee - Suffix *string `json:"suffix,omitempty"` - // Email address of the attendee - EmailAddress *string `json:"email_address,omitempty"` - // Whether the attendee is the organizer of the activity - IsOrganizer *bool `json:"is_organizer,omitempty"` - // Status of the attendee - Status *ActivityAttendeeStatus `json:"status,omitempty"` -} - -func (o *ActivityAttendeeInput) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *ActivityAttendeeInput) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *ActivityAttendeeInput) GetMiddleName() *string { - if o == nil { - return nil - } - return o.MiddleName -} - -func (o *ActivityAttendeeInput) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *ActivityAttendeeInput) GetPrefix() *string { - if o == nil { - return nil - } - return o.Prefix -} - -func (o *ActivityAttendeeInput) GetSuffix() *string { - if o == nil { - return nil - } - return o.Suffix -} - -func (o *ActivityAttendeeInput) GetEmailAddress() *string { - if o == nil { - return nil - } - return o.EmailAddress -} - -func (o *ActivityAttendeeInput) GetIsOrganizer() *bool { - if o == nil { - return nil - } - return o.IsOrganizer -} - -func (o *ActivityAttendeeInput) GetStatus() *ActivityAttendeeStatus { - if o == nil { - return nil - } - return o.Status -} diff --git a/tests/mockserver/internal/sdk/models/components/address.go b/tests/mockserver/internal/sdk/models/components/address.go deleted file mode 100644 index 75275aa0..00000000 --- a/tests/mockserver/internal/sdk/models/components/address.go +++ /dev/null @@ -1,269 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// AddressType - The type of address. -type AddressType string - -const ( - AddressTypePrimary AddressType = "primary" - AddressTypeSecondary AddressType = "secondary" - AddressTypeHome AddressType = "home" - AddressTypeOffice AddressType = "office" - AddressTypeShipping AddressType = "shipping" - AddressTypeBilling AddressType = "billing" - AddressTypeOther AddressType = "other" -) - -func (e AddressType) ToPointer() *AddressType { - return &e -} -func (e *AddressType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "primary": - fallthrough - case "secondary": - fallthrough - case "home": - fallthrough - case "office": - fallthrough - case "shipping": - fallthrough - case "billing": - fallthrough - case "other": - *e = AddressType(v) - return nil - default: - return fmt.Errorf("invalid value for AddressType: %v", v) - } -} - -type Address struct { - // Unique identifier for the address. - ID *string `json:"id,omitempty"` - // The type of address. - Type *AddressType `json:"type,omitempty"` - // The address string. Some APIs don't provide structured address data. - String *string `json:"string,omitempty"` - // The name of the address. - Name *string `json:"name,omitempty"` - // Line 1 of the address e.g. number, street, suite, apt #, etc. - Line1 *string `json:"line1,omitempty"` - // Line 2 of the address - Line2 *string `json:"line2,omitempty"` - // Line 3 of the address - Line3 *string `json:"line3,omitempty"` - // Line 4 of the address - Line4 *string `json:"line4,omitempty"` - // Street number - StreetNumber *string `json:"street_number,omitempty"` - // Name of city. - City *string `json:"city,omitempty"` - // Name of state - State *string `json:"state,omitempty"` - // Zip code or equivalent. - PostalCode *string `json:"postal_code,omitempty"` - // country code according to ISO 3166-1 alpha-2. - Country *string `json:"country,omitempty"` - // Latitude of the address - Latitude *string `json:"latitude,omitempty"` - // Longitude of the address - Longitude *string `json:"longitude,omitempty"` - // Address field that holds a sublocality, such as a county - County *string `json:"county,omitempty"` - // Name of the contact person at the address - ContactName *string `json:"contact_name,omitempty"` - // Salutation of the contact person at the address - Salutation *string `json:"salutation,omitempty"` - // Phone number of the address - PhoneNumber *string `json:"phone_number,omitempty"` - // Fax number of the address - Fax *string `json:"fax,omitempty"` - // Email address of the address - Email *string `json:"email,omitempty"` - // Website of the address - Website *string `json:"website,omitempty"` - // Additional notes - Notes *string `json:"notes,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` -} - -func (o *Address) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Address) GetType() *AddressType { - if o == nil { - return nil - } - return o.Type -} - -func (o *Address) GetString() *string { - if o == nil { - return nil - } - return o.String -} - -func (o *Address) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *Address) GetLine1() *string { - if o == nil { - return nil - } - return o.Line1 -} - -func (o *Address) GetLine2() *string { - if o == nil { - return nil - } - return o.Line2 -} - -func (o *Address) GetLine3() *string { - if o == nil { - return nil - } - return o.Line3 -} - -func (o *Address) GetLine4() *string { - if o == nil { - return nil - } - return o.Line4 -} - -func (o *Address) GetStreetNumber() *string { - if o == nil { - return nil - } - return o.StreetNumber -} - -func (o *Address) GetCity() *string { - if o == nil { - return nil - } - return o.City -} - -func (o *Address) GetState() *string { - if o == nil { - return nil - } - return o.State -} - -func (o *Address) GetPostalCode() *string { - if o == nil { - return nil - } - return o.PostalCode -} - -func (o *Address) GetCountry() *string { - if o == nil { - return nil - } - return o.Country -} - -func (o *Address) GetLatitude() *string { - if o == nil { - return nil - } - return o.Latitude -} - -func (o *Address) GetLongitude() *string { - if o == nil { - return nil - } - return o.Longitude -} - -func (o *Address) GetCounty() *string { - if o == nil { - return nil - } - return o.County -} - -func (o *Address) GetContactName() *string { - if o == nil { - return nil - } - return o.ContactName -} - -func (o *Address) GetSalutation() *string { - if o == nil { - return nil - } - return o.Salutation -} - -func (o *Address) GetPhoneNumber() *string { - if o == nil { - return nil - } - return o.PhoneNumber -} - -func (o *Address) GetFax() *string { - if o == nil { - return nil - } - return o.Fax -} - -func (o *Address) GetEmail() *string { - if o == nil { - return nil - } - return o.Email -} - -func (o *Address) GetWebsite() *string { - if o == nil { - return nil - } - return o.Website -} - -func (o *Address) GetNotes() *string { - if o == nil { - return nil - } - return o.Notes -} - -func (o *Address) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} diff --git a/tests/mockserver/internal/sdk/models/components/agedcreditors.go b/tests/mockserver/internal/sdk/models/components/agedcreditors.go deleted file mode 100644 index ca9153aa..00000000 --- a/tests/mockserver/internal/sdk/models/components/agedcreditors.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/types" - "mockserver/internal/sdk/utils" - "time" -) - -type AgedCreditors struct { - // The exact date and time the report was generated. - ReportGeneratedAt *time.Time `json:"report_generated_at,omitempty"` - // The cutoff date for transactions included in the report. - ReportAsOfDate *types.Date `json:"report_as_of_date,omitempty"` - // Number of aging periods shown in the report. - PeriodCount *int64 `default:"4" json:"period_count"` - // Length of each aging period in days. - PeriodLength *int64 `default:"30" json:"period_length"` - OutstandingBalances []OutstandingBalanceBySupplier `json:"outstanding_balances,omitempty"` -} - -func (a AgedCreditors) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AgedCreditors) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AgedCreditors) GetReportGeneratedAt() *time.Time { - if o == nil { - return nil - } - return o.ReportGeneratedAt -} - -func (o *AgedCreditors) GetReportAsOfDate() *types.Date { - if o == nil { - return nil - } - return o.ReportAsOfDate -} - -func (o *AgedCreditors) GetPeriodCount() *int64 { - if o == nil { - return nil - } - return o.PeriodCount -} - -func (o *AgedCreditors) GetPeriodLength() *int64 { - if o == nil { - return nil - } - return o.PeriodLength -} - -func (o *AgedCreditors) GetOutstandingBalances() []OutstandingBalanceBySupplier { - if o == nil { - return nil - } - return o.OutstandingBalances -} diff --git a/tests/mockserver/internal/sdk/models/components/ageddebtors.go b/tests/mockserver/internal/sdk/models/components/ageddebtors.go deleted file mode 100644 index a4b52c73..00000000 --- a/tests/mockserver/internal/sdk/models/components/ageddebtors.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/types" - "mockserver/internal/sdk/utils" - "time" -) - -type AgedDebtors struct { - // The exact date and time the report was generated. - ReportGeneratedAt *time.Time `json:"report_generated_at,omitempty"` - // The cutoff date for transactions included in the report. - ReportAsOfDate *types.Date `json:"report_as_of_date,omitempty"` - // Number of aging periods shown in the report. - PeriodCount *int64 `default:"4" json:"period_count"` - // Length of each aging period in days. - PeriodLength *int64 `default:"30" json:"period_length"` - OutstandingBalances []OutstandingBalanceByCustomer `json:"outstanding_balances,omitempty"` -} - -func (a AgedDebtors) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AgedDebtors) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AgedDebtors) GetReportGeneratedAt() *time.Time { - if o == nil { - return nil - } - return o.ReportGeneratedAt -} - -func (o *AgedDebtors) GetReportAsOfDate() *types.Date { - if o == nil { - return nil - } - return o.ReportAsOfDate -} - -func (o *AgedDebtors) GetPeriodCount() *int64 { - if o == nil { - return nil - } - return o.PeriodCount -} - -func (o *AgedDebtors) GetPeriodLength() *int64 { - if o == nil { - return nil - } - return o.PeriodLength -} - -func (o *AgedDebtors) GetOutstandingBalances() []OutstandingBalanceByCustomer { - if o == nil { - return nil - } - return o.OutstandingBalances -} diff --git a/tests/mockserver/internal/sdk/models/components/agedreportfilter.go b/tests/mockserver/internal/sdk/models/components/agedreportfilter.go deleted file mode 100644 index 9daa8783..00000000 --- a/tests/mockserver/internal/sdk/models/components/agedreportfilter.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type AgedReportFilter struct { - // Filter by customer id - CustomerID *string `queryParam:"name=customer_id"` - // Filter by supplier id - SupplierID *string `queryParam:"name=supplier_id"` - // The cutoff date for considering transactions - ReportAsOfDate *string `queryParam:"name=report_as_of_date"` - // Number of periods to split the aged creditors report into - PeriodCount *int64 `queryParam:"name=period_count"` - // Length of each period in days - PeriodLength *int64 `queryParam:"name=period_length"` -} - -func (o *AgedReportFilter) GetCustomerID() *string { - if o == nil { - return nil - } - return o.CustomerID -} - -func (o *AgedReportFilter) GetSupplierID() *string { - if o == nil { - return nil - } - return o.SupplierID -} - -func (o *AgedReportFilter) GetReportAsOfDate() *string { - if o == nil { - return nil - } - return o.ReportAsOfDate -} - -func (o *AgedReportFilter) GetPeriodCount() *int64 { - if o == nil { - return nil - } - return o.PeriodCount -} - -func (o *AgedReportFilter) GetPeriodLength() *int64 { - if o == nil { - return nil - } - return o.PeriodLength -} diff --git a/tests/mockserver/internal/sdk/models/components/allocation.go b/tests/mockserver/internal/sdk/models/components/allocation.go deleted file mode 100644 index f9a9f16c..00000000 --- a/tests/mockserver/internal/sdk/models/components/allocation.go +++ /dev/null @@ -1,142 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// AllocationAllocationType - Type of entity this payment should be attributed to. -type AllocationAllocationType string - -const ( - AllocationAllocationTypeInvoice AllocationAllocationType = "invoice" - AllocationAllocationTypeOrder AllocationAllocationType = "order" - AllocationAllocationTypeExpense AllocationAllocationType = "expense" - AllocationAllocationTypeCreditMemo AllocationAllocationType = "credit_memo" - AllocationAllocationTypeOverPayment AllocationAllocationType = "over_payment" - AllocationAllocationTypePrePayment AllocationAllocationType = "pre_payment" - AllocationAllocationTypeJournalEntry AllocationAllocationType = "journal_entry" - AllocationAllocationTypeOther AllocationAllocationType = "other" - AllocationAllocationTypeBill AllocationAllocationType = "bill" -) - -func (e AllocationAllocationType) ToPointer() *AllocationAllocationType { - return &e -} -func (e *AllocationAllocationType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "invoice": - fallthrough - case "order": - fallthrough - case "expense": - fallthrough - case "credit_memo": - fallthrough - case "over_payment": - fallthrough - case "pre_payment": - fallthrough - case "journal_entry": - fallthrough - case "other": - fallthrough - case "bill": - *e = AllocationAllocationType(v) - return nil - default: - return fmt.Errorf("invalid value for AllocationAllocationType: %v", v) - } -} - -type Allocation struct { - // Unique identifier of entity this payment should be attributed to. - ID *string `json:"id,omitempty"` - // Type of entity this payment should be attributed to. - Type *AllocationAllocationType `json:"type,omitempty"` - Code *string `json:"code,omitempty"` - // Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. - Amount *float64 `json:"amount,omitempty"` - // Unique identifier of the allocation - AllocationID *string `json:"allocation_id,omitempty"` -} - -func (o *Allocation) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Allocation) GetType() *AllocationAllocationType { - if o == nil { - return nil - } - return o.Type -} - -func (o *Allocation) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *Allocation) GetAmount() *float64 { - if o == nil { - return nil - } - return o.Amount -} - -func (o *Allocation) GetAllocationID() *string { - if o == nil { - return nil - } - return o.AllocationID -} - -type AllocationInput struct { - // Unique identifier of entity this payment should be attributed to. - ID *string `json:"id,omitempty"` - // Type of entity this payment should be attributed to. - Type *AllocationAllocationType `json:"type,omitempty"` - // Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. - Amount *float64 `json:"amount,omitempty"` - // Unique identifier of the allocation - AllocationID *string `json:"allocation_id,omitempty"` -} - -func (o *AllocationInput) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *AllocationInput) GetType() *AllocationAllocationType { - if o == nil { - return nil - } - return o.Type -} - -func (o *AllocationInput) GetAmount() *float64 { - if o == nil { - return nil - } - return o.Amount -} - -func (o *AllocationInput) GetAllocationID() *string { - if o == nil { - return nil - } - return o.AllocationID -} diff --git a/tests/mockserver/internal/sdk/models/components/api.go b/tests/mockserver/internal/sdk/models/components/api.go deleted file mode 100644 index 8e426808..00000000 --- a/tests/mockserver/internal/sdk/models/components/api.go +++ /dev/null @@ -1,176 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// APIType - Indicates whether the API is a Unified API. If unified_api is false, the API is a Platform API. -type APIType string - -const ( - APITypePlatform APIType = "platform" - APITypeUnified APIType = "unified" -) - -func (e APIType) ToPointer() *APIType { - return &e -} -func (e *APIType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "platform": - fallthrough - case "unified": - *e = APIType(v) - return nil - default: - return fmt.Errorf("invalid value for APIType: %v", v) - } -} - -type Resource struct { - // ID of the resource, typically a lowercased version of its name. - ID *string `json:"id,omitempty"` - // Name of the resource (plural) - Name *string `json:"name,omitempty"` - // Status of the resource. Resources with status live or beta are callable. - Status *ResourceStatus `json:"status,omitempty"` - // Exclude from mapping coverage - ExcludedFromCoverage *bool `json:"excluded_from_coverage,omitempty"` -} - -func (o *Resource) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Resource) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *Resource) GetStatus() *ResourceStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *Resource) GetExcludedFromCoverage() *bool { - if o == nil { - return nil - } - return o.ExcludedFromCoverage -} - -type API struct { - // ID of the API. - ID *string `json:"id,omitempty"` - // Indicates whether the API is a Unified API. If unified_api is false, the API is a Platform API. - Type *APIType `json:"type,omitempty"` - // Name of the API. - Name *string `json:"name,omitempty"` - // Description of the API. - Description *string `json:"description,omitempty"` - // Status of the API. APIs with status live or beta are callable. - Status *APIStatus `json:"status,omitempty"` - // Link to the latest OpenAPI specification of the API. - SpecURL *string `json:"spec_url,omitempty"` - // Link to the API reference of the API. - APIReferenceURL *string `json:"api_reference_url,omitempty"` - // ID of the Postman collection of the API. - PostmanCollectionID *string `json:"postman_collection_id,omitempty"` - // List of categories the API belongs to. - Categories []string `json:"categories,omitempty"` - // List of resources supported in this API. - Resources []Resource `json:"resources,omitempty"` - // List of event types this API supports. - Events []string `json:"events,omitempty"` -} - -func (o *API) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *API) GetType() *APIType { - if o == nil { - return nil - } - return o.Type -} - -func (o *API) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *API) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *API) GetStatus() *APIStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *API) GetSpecURL() *string { - if o == nil { - return nil - } - return o.SpecURL -} - -func (o *API) GetAPIReferenceURL() *string { - if o == nil { - return nil - } - return o.APIReferenceURL -} - -func (o *API) GetPostmanCollectionID() *string { - if o == nil { - return nil - } - return o.PostmanCollectionID -} - -func (o *API) GetCategories() []string { - if o == nil { - return nil - } - return o.Categories -} - -func (o *API) GetResources() []Resource { - if o == nil { - return nil - } - return o.Resources -} - -func (o *API) GetEvents() []string { - if o == nil { - return nil - } - return o.Events -} diff --git a/tests/mockserver/internal/sdk/models/components/apiresource.go b/tests/mockserver/internal/sdk/models/components/apiresource.go deleted file mode 100644 index b553e6a8..00000000 --- a/tests/mockserver/internal/sdk/models/components/apiresource.go +++ /dev/null @@ -1,76 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type LinkedResource struct { - // ID of the resource, typically a lowercased version of name. - ID *string `json:"id,omitempty"` - // Name of the property in our Unified API. - UnifiedProperty *string `json:"unified_property,omitempty"` -} - -func (o *LinkedResource) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *LinkedResource) GetUnifiedProperty() *string { - if o == nil { - return nil - } - return o.UnifiedProperty -} - -// JSON Schema of the resource in our Unified API -type Schema struct { -} - -type APIResource struct { - // ID of the resource, typically a lowercased version of name. - ID *string `json:"id,omitempty"` - // Name of the resource (plural) - Name *string `json:"name,omitempty"` - // Status of the resource. Resources with status live or beta are callable. - Status *ResourceStatus `json:"status,omitempty"` - // List of linked resources. - LinkedResources []LinkedResource `json:"linked_resources,omitempty"` - // JSON Schema of the resource in our Unified API - Schema *Schema `json:"schema,omitempty"` -} - -func (o *APIResource) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *APIResource) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *APIResource) GetStatus() *ResourceStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *APIResource) GetLinkedResources() []LinkedResource { - if o == nil { - return nil - } - return o.LinkedResources -} - -func (o *APIResource) GetSchema() *Schema { - if o == nil { - return nil - } - return o.Schema -} diff --git a/tests/mockserver/internal/sdk/models/components/apiresourcecoverage.go b/tests/mockserver/internal/sdk/models/components/apiresourcecoverage.go deleted file mode 100644 index aa51dd2b..00000000 --- a/tests/mockserver/internal/sdk/models/components/apiresourcecoverage.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type Coverage struct { - // ID of the resource in the Connector's API (downstream) - DownstreamID *string `json:"downstream_id,omitempty"` - // Name of the resource in the Connector's API (downstream) - DownstreamName *string `json:"downstream_name,omitempty"` - // Indicates if pagination (cursor and limit parameters) is supported on the list endpoint of the resource. - PaginationSupported *bool `json:"pagination_supported,omitempty"` - Pagination *PaginationCoverage `json:"pagination,omitempty"` - // List of supported operations on the resource. - SupportedOperations []string `json:"supported_operations,omitempty"` - // Supported filters on the list endpoint of the resource. - SupportedFilters []string `json:"supported_filters,omitempty"` - // Supported sorting properties on the list endpoint of the resource. - SupportedSortBy []string `json:"supported_sort_by,omitempty"` - // Supported fields on the detail endpoint. - SupportedFields []SupportedProperty `json:"supported_fields,omitempty"` - // Supported fields on the list endpoint. - SupportedListFields []SupportedProperty `json:"supported_list_fields,omitempty"` -} - -func (o *Coverage) GetDownstreamID() *string { - if o == nil { - return nil - } - return o.DownstreamID -} - -func (o *Coverage) GetDownstreamName() *string { - if o == nil { - return nil - } - return o.DownstreamName -} - -func (o *Coverage) GetPaginationSupported() *bool { - if o == nil { - return nil - } - return o.PaginationSupported -} - -func (o *Coverage) GetPagination() *PaginationCoverage { - if o == nil { - return nil - } - return o.Pagination -} - -func (o *Coverage) GetSupportedOperations() []string { - if o == nil { - return nil - } - return o.SupportedOperations -} - -func (o *Coverage) GetSupportedFilters() []string { - if o == nil { - return nil - } - return o.SupportedFilters -} - -func (o *Coverage) GetSupportedSortBy() []string { - if o == nil { - return nil - } - return o.SupportedSortBy -} - -func (o *Coverage) GetSupportedFields() []SupportedProperty { - if o == nil { - return nil - } - return o.SupportedFields -} - -func (o *Coverage) GetSupportedListFields() []SupportedProperty { - if o == nil { - return nil - } - return o.SupportedListFields -} - -type APIResourceCoverage struct { - // ID of the resource, typically a lowercased version of name. - ID *string `json:"id,omitempty"` - // Name of the resource (plural) - Name *string `json:"name,omitempty"` - // Status of the resource. Resources with status live or beta are callable. - Status *ResourceStatus `json:"status,omitempty"` - Coverage []Coverage `json:"coverage,omitempty"` -} - -func (o *APIResourceCoverage) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *APIResourceCoverage) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *APIResourceCoverage) GetStatus() *ResourceStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *APIResourceCoverage) GetCoverage() []Coverage { - if o == nil { - return nil - } - return o.Coverage -} diff --git a/tests/mockserver/internal/sdk/models/components/apisfilter.go b/tests/mockserver/internal/sdk/models/components/apisfilter.go deleted file mode 100644 index 7a9ce96e..00000000 --- a/tests/mockserver/internal/sdk/models/components/apisfilter.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type ApisFilter struct { - // Status of the API. APIs with status live or beta are callable. - Status *APIStatus `queryParam:"name=status"` -} - -func (o *ApisFilter) GetStatus() *APIStatus { - if o == nil { - return nil - } - return o.Status -} diff --git a/tests/mockserver/internal/sdk/models/components/apistatus.go b/tests/mockserver/internal/sdk/models/components/apistatus.go deleted file mode 100644 index 29fe340a..00000000 --- a/tests/mockserver/internal/sdk/models/components/apistatus.go +++ /dev/null @@ -1,41 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// APIStatus - Status of the API. APIs with status live or beta are callable. -type APIStatus string - -const ( - APIStatusLive APIStatus = "live" - APIStatusBeta APIStatus = "beta" - APIStatusDevelopment APIStatus = "development" - APIStatusConsidering APIStatus = "considering" -) - -func (e APIStatus) ToPointer() *APIStatus { - return &e -} -func (e *APIStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "live": - fallthrough - case "beta": - fallthrough - case "development": - fallthrough - case "considering": - *e = APIStatus(v) - return nil - default: - return fmt.Errorf("invalid value for APIStatus: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/applicant.go b/tests/mockserver/internal/sdk/models/components/applicant.go deleted file mode 100644 index 68ccac08..00000000 --- a/tests/mockserver/internal/sdk/models/components/applicant.go +++ /dev/null @@ -1,773 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/types" - "mockserver/internal/sdk/utils" - "time" -) - -// ApplicantType - The type of website -type ApplicantType string - -const ( - ApplicantTypePrimary ApplicantType = "primary" - ApplicantTypeSecondary ApplicantType = "secondary" - ApplicantTypeWork ApplicantType = "work" - ApplicantTypePersonal ApplicantType = "personal" - ApplicantTypeOther ApplicantType = "other" -) - -func (e ApplicantType) ToPointer() *ApplicantType { - return &e -} -func (e *ApplicantType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "primary": - fallthrough - case "secondary": - fallthrough - case "work": - fallthrough - case "personal": - fallthrough - case "other": - *e = ApplicantType(v) - return nil - default: - return fmt.Errorf("invalid value for ApplicantType: %v", v) - } -} - -type ApplicantWebsite struct { - // Unique identifier for the website - ID *string `json:"id,omitempty"` - // The website URL - URL string `json:"url"` - // The type of website - Type *ApplicantType `json:"type,omitempty"` -} - -func (o *ApplicantWebsite) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *ApplicantWebsite) GetURL() string { - if o == nil { - return "" - } - return o.URL -} - -func (o *ApplicantWebsite) GetType() *ApplicantType { - if o == nil { - return nil - } - return o.Type -} - -type ApplicantSocialLink struct { - // Unique identifier of the social link - ID *string `json:"id,omitempty"` - // URL of the social link, e.g. https://www.twitter.com/apideck - URL string `json:"url"` - // Type of the social link, e.g. twitter - Type *string `json:"type,omitempty"` -} - -func (o *ApplicantSocialLink) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *ApplicantSocialLink) GetURL() string { - if o == nil { - return "" - } - return o.URL -} - -func (o *ApplicantSocialLink) GetType() *string { - if o == nil { - return nil - } - return o.Type -} - -type Applicant struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The name of an applicant. - Name *string `json:"name,omitempty"` - // The first name of the person. - FirstName *string `json:"first_name,omitempty"` - // The last name of the person. - LastName *string `json:"last_name,omitempty"` - // Middle name of the person. - MiddleName *string `json:"middle_name,omitempty"` - // The initials of the person, usually derived from their first, middle, and last names. - Initials *string `json:"initials,omitempty"` - // The date of birth of the person. - Birthday *types.Date `json:"birthday,omitempty"` - CoverLetter *string `json:"cover_letter,omitempty"` - JobURL *string `json:"job_url,omitempty"` - // The URL of the photo of a person. - PhotoURL *string `json:"photo_url,omitempty"` - // Typically a list of previous companies where the contact has worked or schools that the contact has attended - Headline *string `json:"headline,omitempty"` - // The job title of the person. - Title *string `json:"title,omitempty"` - Emails []Email `json:"emails,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - PhoneNumbers []PhoneNumber `json:"phone_numbers,omitempty"` - Addresses []Address `json:"addresses,omitempty"` - Websites []ApplicantWebsite `json:"websites,omitempty"` - SocialLinks []ApplicantSocialLink `json:"social_links,omitempty"` - StageID *string `json:"stage_id,omitempty"` - RecruiterID *string `json:"recruiter_id,omitempty"` - CoordinatorID *string `json:"coordinator_id,omitempty"` - ApplicationIds []string `json:"application_ids,omitempty"` - Applications []string `json:"applications,omitempty"` - Followers []string `json:"followers,omitempty"` - Sources []string `json:"sources,omitempty"` - SourceID *string `json:"source_id,omitempty"` - Confidential *bool `json:"confidential,omitempty"` - Anonymized *bool `json:"anonymized,omitempty"` - Tags []string `json:"tags,omitempty"` - Archived *bool `json:"archived,omitempty"` - LastInteractionAt *time.Time `json:"last_interaction_at,omitempty"` - OwnerID *string `json:"owner_id,omitempty"` - SourcedBy *string `json:"sourced_by,omitempty"` - CvURL *string `json:"cv_url,omitempty"` - RecordURL *string `json:"record_url,omitempty"` - RejectedAt *time.Time `json:"rejected_at,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // Flag to indicate if the object is deleted. - Deleted *bool `json:"deleted,omitempty"` - // The user who deleted the object. - DeletedBy *string `json:"deleted_by,omitempty"` - // The time at which the object was deleted. - DeletedAt *time.Time `json:"deleted_at,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (a Applicant) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *Applicant) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Applicant) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Applicant) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *Applicant) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *Applicant) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *Applicant) GetMiddleName() *string { - if o == nil { - return nil - } - return o.MiddleName -} - -func (o *Applicant) GetInitials() *string { - if o == nil { - return nil - } - return o.Initials -} - -func (o *Applicant) GetBirthday() *types.Date { - if o == nil { - return nil - } - return o.Birthday -} - -func (o *Applicant) GetCoverLetter() *string { - if o == nil { - return nil - } - return o.CoverLetter -} - -func (o *Applicant) GetJobURL() *string { - if o == nil { - return nil - } - return o.JobURL -} - -func (o *Applicant) GetPhotoURL() *string { - if o == nil { - return nil - } - return o.PhotoURL -} - -func (o *Applicant) GetHeadline() *string { - if o == nil { - return nil - } - return o.Headline -} - -func (o *Applicant) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *Applicant) GetEmails() []Email { - if o == nil { - return nil - } - return o.Emails -} - -func (o *Applicant) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *Applicant) GetPhoneNumbers() []PhoneNumber { - if o == nil { - return nil - } - return o.PhoneNumbers -} - -func (o *Applicant) GetAddresses() []Address { - if o == nil { - return nil - } - return o.Addresses -} - -func (o *Applicant) GetWebsites() []ApplicantWebsite { - if o == nil { - return nil - } - return o.Websites -} - -func (o *Applicant) GetSocialLinks() []ApplicantSocialLink { - if o == nil { - return nil - } - return o.SocialLinks -} - -func (o *Applicant) GetStageID() *string { - if o == nil { - return nil - } - return o.StageID -} - -func (o *Applicant) GetRecruiterID() *string { - if o == nil { - return nil - } - return o.RecruiterID -} - -func (o *Applicant) GetCoordinatorID() *string { - if o == nil { - return nil - } - return o.CoordinatorID -} - -func (o *Applicant) GetApplicationIds() []string { - if o == nil { - return nil - } - return o.ApplicationIds -} - -func (o *Applicant) GetApplications() []string { - if o == nil { - return nil - } - return o.Applications -} - -func (o *Applicant) GetFollowers() []string { - if o == nil { - return nil - } - return o.Followers -} - -func (o *Applicant) GetSources() []string { - if o == nil { - return nil - } - return o.Sources -} - -func (o *Applicant) GetSourceID() *string { - if o == nil { - return nil - } - return o.SourceID -} - -func (o *Applicant) GetConfidential() *bool { - if o == nil { - return nil - } - return o.Confidential -} - -func (o *Applicant) GetAnonymized() *bool { - if o == nil { - return nil - } - return o.Anonymized -} - -func (o *Applicant) GetTags() []string { - if o == nil { - return nil - } - return o.Tags -} - -func (o *Applicant) GetArchived() *bool { - if o == nil { - return nil - } - return o.Archived -} - -func (o *Applicant) GetLastInteractionAt() *time.Time { - if o == nil { - return nil - } - return o.LastInteractionAt -} - -func (o *Applicant) GetOwnerID() *string { - if o == nil { - return nil - } - return o.OwnerID -} - -func (o *Applicant) GetSourcedBy() *string { - if o == nil { - return nil - } - return o.SourcedBy -} - -func (o *Applicant) GetCvURL() *string { - if o == nil { - return nil - } - return o.CvURL -} - -func (o *Applicant) GetRecordURL() *string { - if o == nil { - return nil - } - return o.RecordURL -} - -func (o *Applicant) GetRejectedAt() *time.Time { - if o == nil { - return nil - } - return o.RejectedAt -} - -func (o *Applicant) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Applicant) GetDeleted() *bool { - if o == nil { - return nil - } - return o.Deleted -} - -func (o *Applicant) GetDeletedBy() *string { - if o == nil { - return nil - } - return o.DeletedBy -} - -func (o *Applicant) GetDeletedAt() *time.Time { - if o == nil { - return nil - } - return o.DeletedAt -} - -func (o *Applicant) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *Applicant) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *Applicant) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Applicant) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Applicant) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type ApplicantInput struct { - // The name of an applicant. - Name *string `json:"name,omitempty"` - // The first name of the person. - FirstName *string `json:"first_name,omitempty"` - // The last name of the person. - LastName *string `json:"last_name,omitempty"` - // Middle name of the person. - MiddleName *string `json:"middle_name,omitempty"` - // The initials of the person, usually derived from their first, middle, and last names. - Initials *string `json:"initials,omitempty"` - // The date of birth of the person. - Birthday *types.Date `json:"birthday,omitempty"` - CoverLetter *string `json:"cover_letter,omitempty"` - // The URL of the photo of a person. - PhotoURL *string `json:"photo_url,omitempty"` - // Typically a list of previous companies where the contact has worked or schools that the contact has attended - Headline *string `json:"headline,omitempty"` - // The job title of the person. - Title *string `json:"title,omitempty"` - Emails []Email `json:"emails,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - PhoneNumbers []PhoneNumber `json:"phone_numbers,omitempty"` - Addresses []Address `json:"addresses,omitempty"` - Websites []ApplicantWebsite `json:"websites,omitempty"` - SocialLinks []ApplicantSocialLink `json:"social_links,omitempty"` - StageID *string `json:"stage_id,omitempty"` - RecruiterID *string `json:"recruiter_id,omitempty"` - CoordinatorID *string `json:"coordinator_id,omitempty"` - ApplicationIds []string `json:"application_ids,omitempty"` - Applications []string `json:"applications,omitempty"` - Followers []string `json:"followers,omitempty"` - Sources []string `json:"sources,omitempty"` - Confidential *bool `json:"confidential,omitempty"` - Anonymized *bool `json:"anonymized,omitempty"` - Tags []string `json:"tags,omitempty"` - Archived *bool `json:"archived,omitempty"` - OwnerID *string `json:"owner_id,omitempty"` - RecordURL *string `json:"record_url,omitempty"` - // Flag to indicate if the object is deleted. - Deleted *bool `json:"deleted,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (a ApplicantInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *ApplicantInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ApplicantInput) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *ApplicantInput) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *ApplicantInput) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *ApplicantInput) GetMiddleName() *string { - if o == nil { - return nil - } - return o.MiddleName -} - -func (o *ApplicantInput) GetInitials() *string { - if o == nil { - return nil - } - return o.Initials -} - -func (o *ApplicantInput) GetBirthday() *types.Date { - if o == nil { - return nil - } - return o.Birthday -} - -func (o *ApplicantInput) GetCoverLetter() *string { - if o == nil { - return nil - } - return o.CoverLetter -} - -func (o *ApplicantInput) GetPhotoURL() *string { - if o == nil { - return nil - } - return o.PhotoURL -} - -func (o *ApplicantInput) GetHeadline() *string { - if o == nil { - return nil - } - return o.Headline -} - -func (o *ApplicantInput) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *ApplicantInput) GetEmails() []Email { - if o == nil { - return nil - } - return o.Emails -} - -func (o *ApplicantInput) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *ApplicantInput) GetPhoneNumbers() []PhoneNumber { - if o == nil { - return nil - } - return o.PhoneNumbers -} - -func (o *ApplicantInput) GetAddresses() []Address { - if o == nil { - return nil - } - return o.Addresses -} - -func (o *ApplicantInput) GetWebsites() []ApplicantWebsite { - if o == nil { - return nil - } - return o.Websites -} - -func (o *ApplicantInput) GetSocialLinks() []ApplicantSocialLink { - if o == nil { - return nil - } - return o.SocialLinks -} - -func (o *ApplicantInput) GetStageID() *string { - if o == nil { - return nil - } - return o.StageID -} - -func (o *ApplicantInput) GetRecruiterID() *string { - if o == nil { - return nil - } - return o.RecruiterID -} - -func (o *ApplicantInput) GetCoordinatorID() *string { - if o == nil { - return nil - } - return o.CoordinatorID -} - -func (o *ApplicantInput) GetApplicationIds() []string { - if o == nil { - return nil - } - return o.ApplicationIds -} - -func (o *ApplicantInput) GetApplications() []string { - if o == nil { - return nil - } - return o.Applications -} - -func (o *ApplicantInput) GetFollowers() []string { - if o == nil { - return nil - } - return o.Followers -} - -func (o *ApplicantInput) GetSources() []string { - if o == nil { - return nil - } - return o.Sources -} - -func (o *ApplicantInput) GetConfidential() *bool { - if o == nil { - return nil - } - return o.Confidential -} - -func (o *ApplicantInput) GetAnonymized() *bool { - if o == nil { - return nil - } - return o.Anonymized -} - -func (o *ApplicantInput) GetTags() []string { - if o == nil { - return nil - } - return o.Tags -} - -func (o *ApplicantInput) GetArchived() *bool { - if o == nil { - return nil - } - return o.Archived -} - -func (o *ApplicantInput) GetOwnerID() *string { - if o == nil { - return nil - } - return o.OwnerID -} - -func (o *ApplicantInput) GetRecordURL() *string { - if o == nil { - return nil - } - return o.RecordURL -} - -func (o *ApplicantInput) GetDeleted() *bool { - if o == nil { - return nil - } - return o.Deleted -} - -func (o *ApplicantInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/applicantsfilter.go b/tests/mockserver/internal/sdk/models/components/applicantsfilter.go deleted file mode 100644 index fa586d30..00000000 --- a/tests/mockserver/internal/sdk/models/components/applicantsfilter.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type ApplicantsFilter struct { - // Id of the job to filter on - JobID *string `queryParam:"name=job_id"` -} - -func (o *ApplicantsFilter) GetJobID() *string { - if o == nil { - return nil - } - return o.JobID -} diff --git a/tests/mockserver/internal/sdk/models/components/application.go b/tests/mockserver/internal/sdk/models/components/application.go deleted file mode 100644 index 6aca4741..00000000 --- a/tests/mockserver/internal/sdk/models/components/application.go +++ /dev/null @@ -1,218 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -type ApplicationStatus string - -const ( - ApplicationStatusOpen ApplicationStatus = "open" - ApplicationStatusRejected ApplicationStatus = "rejected" - ApplicationStatusHired ApplicationStatus = "hired" - ApplicationStatusConverted ApplicationStatus = "converted" - ApplicationStatusOther ApplicationStatus = "other" -) - -func (e ApplicationStatus) ToPointer() *ApplicationStatus { - return &e -} -func (e *ApplicationStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "open": - fallthrough - case "rejected": - fallthrough - case "hired": - fallthrough - case "converted": - fallthrough - case "other": - *e = ApplicationStatus(v) - return nil - default: - return fmt.Errorf("invalid value for ApplicationStatus: %v", v) - } -} - -type ApplicationStage struct { - // Stage the candidate should be in. If omitted, the default stage for this job will be used. - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` -} - -func (o *ApplicationStage) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *ApplicationStage) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -type Application struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - ApplicantID *string `json:"applicant_id"` - JobID *string `json:"job_id"` - Status *ApplicationStatus `json:"status,omitempty"` - Stage *ApplicationStage `json:"stage,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (a Application) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *Application) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Application) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Application) GetApplicantID() *string { - if o == nil { - return nil - } - return o.ApplicantID -} - -func (o *Application) GetJobID() *string { - if o == nil { - return nil - } - return o.JobID -} - -func (o *Application) GetStatus() *ApplicationStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *Application) GetStage() *ApplicationStage { - if o == nil { - return nil - } - return o.Stage -} - -func (o *Application) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Application) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *Application) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *Application) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Application) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Application) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type ApplicationInput struct { - ApplicantID *string `json:"applicant_id"` - JobID *string `json:"job_id"` - Status *ApplicationStatus `json:"status,omitempty"` - Stage *ApplicationStage `json:"stage,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *ApplicationInput) GetApplicantID() *string { - if o == nil { - return nil - } - return o.ApplicantID -} - -func (o *ApplicationInput) GetJobID() *string { - if o == nil { - return nil - } - return o.JobID -} - -func (o *ApplicationInput) GetStatus() *ApplicationStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *ApplicationInput) GetStage() *ApplicationStage { - if o == nil { - return nil - } - return o.Stage -} - -func (o *ApplicationInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/assignee.go b/tests/mockserver/internal/sdk/models/components/assignee.go deleted file mode 100644 index 61d9065c..00000000 --- a/tests/mockserver/internal/sdk/models/components/assignee.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type Assignee struct { - // A unique identifier for an object. - ID string `json:"id"` - Username *string `json:"username,omitempty"` -} - -func (o *Assignee) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *Assignee) GetUsername() *string { - if o == nil { - return nil - } - return o.Username -} diff --git a/tests/mockserver/internal/sdk/models/components/assigneeinput.go b/tests/mockserver/internal/sdk/models/components/assigneeinput.go deleted file mode 100644 index afa88a90..00000000 --- a/tests/mockserver/internal/sdk/models/components/assigneeinput.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type AssigneeInput struct { - // A unique identifier for an object. - ID string `json:"id"` -} - -func (o *AssigneeInput) GetID() string { - if o == nil { - return "" - } - return o.ID -} diff --git a/tests/mockserver/internal/sdk/models/components/attachment.go b/tests/mockserver/internal/sdk/models/components/attachment.go deleted file mode 100644 index e0eddbb6..00000000 --- a/tests/mockserver/internal/sdk/models/components/attachment.go +++ /dev/null @@ -1,138 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type Attachment struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The display id of the file - DisplayID *string `json:"display_id,omitempty"` - // The name of the file - Name *string `json:"name,omitempty"` - // The MIME type of the file. - MimeType *string `json:"mime_type,omitempty"` - // The size of the file in bytes - Size *int64 `json:"size,omitempty"` - Reference *AttachmentReference `json:"reference,omitempty"` - // Optional description of the file - Description *string `json:"description,omitempty"` - // The folder id where this attachment belong to - ParentFolderID *string `json:"parent_folder_id,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (a Attachment) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *Attachment) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Attachment) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Attachment) GetDisplayID() *string { - if o == nil { - return nil - } - return o.DisplayID -} - -func (o *Attachment) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *Attachment) GetMimeType() *string { - if o == nil { - return nil - } - return o.MimeType -} - -func (o *Attachment) GetSize() *int64 { - if o == nil { - return nil - } - return o.Size -} - -func (o *Attachment) GetReference() *AttachmentReference { - if o == nil { - return nil - } - return o.Reference -} - -func (o *Attachment) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *Attachment) GetParentFolderID() *string { - if o == nil { - return nil - } - return o.ParentFolderID -} - -func (o *Attachment) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *Attachment) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *Attachment) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Attachment) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Attachment) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/attachmentreference.go b/tests/mockserver/internal/sdk/models/components/attachmentreference.go deleted file mode 100644 index e7c8d6a8..00000000 --- a/tests/mockserver/internal/sdk/models/components/attachmentreference.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type AttachmentReference struct { - Type *AttachmentReferenceType `json:"type,omitempty"` - // A unique identifier for an object. - ID *string `json:"id,omitempty"` -} - -func (o *AttachmentReference) GetType() *AttachmentReferenceType { - if o == nil { - return nil - } - return o.Type -} - -func (o *AttachmentReference) GetID() *string { - if o == nil { - return nil - } - return o.ID -} diff --git a/tests/mockserver/internal/sdk/models/components/attachmentreferencetype.go b/tests/mockserver/internal/sdk/models/components/attachmentreferencetype.go deleted file mode 100644 index a8207663..00000000 --- a/tests/mockserver/internal/sdk/models/components/attachmentreferencetype.go +++ /dev/null @@ -1,37 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -type AttachmentReferenceType string - -const ( - AttachmentReferenceTypeInvoice AttachmentReferenceType = "invoice" - AttachmentReferenceTypeBill AttachmentReferenceType = "bill" - AttachmentReferenceTypeExpense AttachmentReferenceType = "expense" -) - -func (e AttachmentReferenceType) ToPointer() *AttachmentReferenceType { - return &e -} -func (e *AttachmentReferenceType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "invoice": - fallthrough - case "bill": - fallthrough - case "expense": - *e = AttachmentReferenceType(v) - return nil - default: - return fmt.Errorf("invalid value for AttachmentReferenceType: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/authtype.go b/tests/mockserver/internal/sdk/models/components/authtype.go deleted file mode 100644 index 2a266282..00000000 --- a/tests/mockserver/internal/sdk/models/components/authtype.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// AuthType - Type of authorization used by the connector -type AuthType string - -const ( - AuthTypeOauth2 AuthType = "oauth2" - AuthTypeAPIKey AuthType = "apiKey" - AuthTypeBasic AuthType = "basic" - AuthTypeCustom AuthType = "custom" - AuthTypeNone AuthType = "none" -) - -func (e AuthType) ToPointer() *AuthType { - return &e -} -func (e *AuthType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "oauth2": - fallthrough - case "apiKey": - fallthrough - case "basic": - fallthrough - case "custom": - fallthrough - case "none": - *e = AuthType(v) - return nil - default: - return fmt.Errorf("invalid value for AuthType: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/badrequestresponseerror.go b/tests/mockserver/internal/sdk/models/components/badrequestresponseerror.go deleted file mode 100644 index 0356541b..00000000 --- a/tests/mockserver/internal/sdk/models/components/badrequestresponseerror.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "errors" - "fmt" - "mockserver/internal/sdk/utils" -) - -type BadRequestResponseDetailType string - -const ( - BadRequestResponseDetailTypeStr BadRequestResponseDetailType = "str" - BadRequestResponseDetailTypeMapOfAny BadRequestResponseDetailType = "mapOfAny" -) - -// BadRequestResponseDetail - Contains parameter or domain specific information related to the error and why it occurred. -type BadRequestResponseDetail struct { - Str *string `queryParam:"inline"` - MapOfAny map[string]any `queryParam:"inline"` - - Type BadRequestResponseDetailType -} - -func CreateBadRequestResponseDetailStr(str string) BadRequestResponseDetail { - typ := BadRequestResponseDetailTypeStr - - return BadRequestResponseDetail{ - Str: &str, - Type: typ, - } -} - -func CreateBadRequestResponseDetailMapOfAny(mapOfAny map[string]any) BadRequestResponseDetail { - typ := BadRequestResponseDetailTypeMapOfAny - - return BadRequestResponseDetail{ - MapOfAny: mapOfAny, - Type: typ, - } -} - -func (u *BadRequestResponseDetail) UnmarshalJSON(data []byte) error { - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = BadRequestResponseDetailTypeStr - return nil - } - - var mapOfAny map[string]any = map[string]any{} - if err := utils.UnmarshalJSON(data, &mapOfAny, "", true, true); err == nil { - u.MapOfAny = mapOfAny - u.Type = BadRequestResponseDetailTypeMapOfAny - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for BadRequestResponseDetail", string(data)) -} - -func (u BadRequestResponseDetail) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.MapOfAny != nil { - return utils.MarshalJSON(u.MapOfAny, "", true) - } - - return nil, errors.New("could not marshal union type BadRequestResponseDetail: all fields are null") -} diff --git a/tests/mockserver/internal/sdk/models/components/balancebyperiod.go b/tests/mockserver/internal/sdk/models/components/balancebyperiod.go deleted file mode 100644 index 3f464121..00000000 --- a/tests/mockserver/internal/sdk/models/components/balancebyperiod.go +++ /dev/null @@ -1,57 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/types" - "mockserver/internal/sdk/utils" -) - -type BalanceByPeriod struct { - // The starting date of the period. If not provided, it represents the oldest period, where all transactions due before the specified `end_date` are included. - StartDate *types.Date `json:"start_date,omitempty"` - // The ending date of the period. If not provided, it represents an open-ended period starting from the `start_date`, typically capturing future-dated transactions that are not yet aged. - EndDate *types.Date `json:"end_date,omitempty"` - // Total amount of the period. - TotalAmount *float64 `json:"total_amount,omitempty"` - BalancesByTransaction []BalanceByTransaction `json:"balances_by_transaction,omitempty"` -} - -func (b BalanceByPeriod) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(b, "", false) -} - -func (b *BalanceByPeriod) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &b, "", false, false); err != nil { - return err - } - return nil -} - -func (o *BalanceByPeriod) GetStartDate() *types.Date { - if o == nil { - return nil - } - return o.StartDate -} - -func (o *BalanceByPeriod) GetEndDate() *types.Date { - if o == nil { - return nil - } - return o.EndDate -} - -func (o *BalanceByPeriod) GetTotalAmount() *float64 { - if o == nil { - return nil - } - return o.TotalAmount -} - -func (o *BalanceByPeriod) GetBalancesByTransaction() []BalanceByTransaction { - if o == nil { - return nil - } - return o.BalancesByTransaction -} diff --git a/tests/mockserver/internal/sdk/models/components/balancebytransaction.go b/tests/mockserver/internal/sdk/models/components/balancebytransaction.go deleted file mode 100644 index c394445c..00000000 --- a/tests/mockserver/internal/sdk/models/components/balancebytransaction.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/types" - "mockserver/internal/sdk/utils" -) - -// BalanceByTransactionTransactionType - Type of the transaction. -type BalanceByTransactionTransactionType string - -const ( - BalanceByTransactionTransactionTypeInvoice BalanceByTransactionTransactionType = "invoice" - BalanceByTransactionTransactionTypeCreditNote BalanceByTransactionTransactionType = "credit_note" - BalanceByTransactionTransactionTypeBill BalanceByTransactionTransactionType = "bill" - BalanceByTransactionTransactionTypePayment BalanceByTransactionTransactionType = "payment" - BalanceByTransactionTransactionTypeBillPayment BalanceByTransactionTransactionType = "bill_payment" -) - -func (e BalanceByTransactionTransactionType) ToPointer() *BalanceByTransactionTransactionType { - return &e -} -func (e *BalanceByTransactionTransactionType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "invoice": - fallthrough - case "credit_note": - fallthrough - case "bill": - fallthrough - case "payment": - fallthrough - case "bill_payment": - *e = BalanceByTransactionTransactionType(v) - return nil - default: - return fmt.Errorf("invalid value for BalanceByTransactionTransactionType: %v", v) - } -} - -type BalanceByTransaction struct { - // Unique identifier for the transaction. - TransactionID *string `json:"transaction_id,omitempty"` - // Date of the transaction. - TransactionDate *types.Date `json:"transaction_date,omitempty"` - // Type of the transaction. - TransactionType *BalanceByTransactionTransactionType `json:"transaction_type,omitempty"` - // Due date of the transaction. - DueDate *types.Date `json:"due_date,omitempty"` - // Original amount of the transaction. - OriginalAmount *float64 `json:"original_amount,omitempty"` - // Outstanding balance of the transaction. - OutstandingBalance *float64 `json:"outstanding_balance,omitempty"` - // Transaction number of the transaction. - TransactionNumber *string `json:"transaction_number,omitempty"` -} - -func (b BalanceByTransaction) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(b, "", false) -} - -func (b *BalanceByTransaction) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &b, "", false, false); err != nil { - return err - } - return nil -} - -func (o *BalanceByTransaction) GetTransactionID() *string { - if o == nil { - return nil - } - return o.TransactionID -} - -func (o *BalanceByTransaction) GetTransactionDate() *types.Date { - if o == nil { - return nil - } - return o.TransactionDate -} - -func (o *BalanceByTransaction) GetTransactionType() *BalanceByTransactionTransactionType { - if o == nil { - return nil - } - return o.TransactionType -} - -func (o *BalanceByTransaction) GetDueDate() *types.Date { - if o == nil { - return nil - } - return o.DueDate -} - -func (o *BalanceByTransaction) GetOriginalAmount() *float64 { - if o == nil { - return nil - } - return o.OriginalAmount -} - -func (o *BalanceByTransaction) GetOutstandingBalance() *float64 { - if o == nil { - return nil - } - return o.OutstandingBalance -} - -func (o *BalanceByTransaction) GetTransactionNumber() *string { - if o == nil { - return nil - } - return o.TransactionNumber -} diff --git a/tests/mockserver/internal/sdk/models/components/balancesheet.go b/tests/mockserver/internal/sdk/models/components/balancesheet.go deleted file mode 100644 index 30ad166d..00000000 --- a/tests/mockserver/internal/sdk/models/components/balancesheet.go +++ /dev/null @@ -1,364 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -// BalanceSheetAssetsAccount - A balance sheet assets account represents the financial position of a company at a specific point in time. -type BalanceSheetAssetsAccount struct { - // The unique identifier for the account. - AccountID *string `json:"account_id,omitempty"` - // The account code of the account - Code *string `json:"code,omitempty"` - // The name of the account. - Name *string `json:"name,omitempty"` - // The amount or value of the item - Value *float64 `json:"value,omitempty"` - // A list of balance sheet accounts - Items any `json:"items,omitempty"` -} - -func (o *BalanceSheetAssetsAccount) GetAccountID() *string { - if o == nil { - return nil - } - return o.AccountID -} - -func (o *BalanceSheetAssetsAccount) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *BalanceSheetAssetsAccount) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *BalanceSheetAssetsAccount) GetValue() *float64 { - if o == nil { - return nil - } - return o.Value -} - -func (o *BalanceSheetAssetsAccount) GetItems() any { - if o == nil { - return nil - } - return o.Items -} - -// BalanceSheetLiabilitiesAccount - A balance sheet liabilities account represents the financial position of a company at a specific point in time. -type BalanceSheetLiabilitiesAccount struct { - // The unique identifier for the account. - AccountID *string `json:"account_id,omitempty"` - // The account code of the account - Code *string `json:"code,omitempty"` - // The name of the account. - Name *string `json:"name,omitempty"` - // The amount or value of the item - Value *float64 `json:"value,omitempty"` - // A list of balance sheet accounts - Items any `json:"items,omitempty"` -} - -func (o *BalanceSheetLiabilitiesAccount) GetAccountID() *string { - if o == nil { - return nil - } - return o.AccountID -} - -func (o *BalanceSheetLiabilitiesAccount) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *BalanceSheetLiabilitiesAccount) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *BalanceSheetLiabilitiesAccount) GetValue() *float64 { - if o == nil { - return nil - } - return o.Value -} - -func (o *BalanceSheetLiabilitiesAccount) GetItems() any { - if o == nil { - return nil - } - return o.Items -} - -// BalanceSheetEquityAccount - A balance sheet equity account represents the financial position of a company at a specific point in time. -type BalanceSheetEquityAccount struct { - // The unique identifier for the account. - AccountID *string `json:"account_id,omitempty"` - // The account code of the account - Code *string `json:"code,omitempty"` - // The name of the account. - Name *string `json:"name,omitempty"` - // The amount or value of the item - Value *float64 `json:"value,omitempty"` - // A list of balance sheet accounts - Items any `json:"items,omitempty"` -} - -func (o *BalanceSheetEquityAccount) GetAccountID() *string { - if o == nil { - return nil - } - return o.AccountID -} - -func (o *BalanceSheetEquityAccount) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *BalanceSheetEquityAccount) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *BalanceSheetEquityAccount) GetValue() *float64 { - if o == nil { - return nil - } - return o.Value -} - -func (o *BalanceSheetEquityAccount) GetItems() any { - if o == nil { - return nil - } - return o.Items -} - -// BalanceSheetUncategorizedItemsAccount - A balance sheet uncategorized items account represents the financial position of a company at a specific point in time. -type BalanceSheetUncategorizedItemsAccount struct { - // The unique identifier for the account. - AccountID *string `json:"account_id,omitempty"` - // The account code of the account - Code *string `json:"code,omitempty"` - // The name of the account. - Name *string `json:"name,omitempty"` - // The amount or value of the item - Value *float64 `json:"value,omitempty"` - // A list of balance sheet accounts - Items any `json:"items,omitempty"` -} - -func (o *BalanceSheetUncategorizedItemsAccount) GetAccountID() *string { - if o == nil { - return nil - } - return o.AccountID -} - -func (o *BalanceSheetUncategorizedItemsAccount) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *BalanceSheetUncategorizedItemsAccount) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *BalanceSheetUncategorizedItemsAccount) GetValue() *float64 { - if o == nil { - return nil - } - return o.Value -} - -func (o *BalanceSheetUncategorizedItemsAccount) GetItems() any { - if o == nil { - return nil - } - return o.Items -} - -type Report struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The name of the report - ReportName *string `json:"report_name,omitempty"` - // The start date of the report - StartDate *string `json:"start_date,omitempty"` - // The start date of the report - EndDate string `json:"end_date"` - // 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"` - // A balance sheet assets account represents the financial position of a company at a specific point in time. - Assets BalanceSheetAssetsAccount `json:"assets"` - // A balance sheet liabilities account represents the financial position of a company at a specific point in time. - Liabilities BalanceSheetLiabilitiesAccount `json:"liabilities"` - // A balance sheet equity account represents the financial position of a company at a specific point in time. - Equity BalanceSheetEquityAccount `json:"equity"` - // The net assets of the balance sheet - NetAssets *float64 `json:"net_assets,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // A balance sheet uncategorized items account represents the financial position of a company at a specific point in time. - UncategorizedItems *BalanceSheetUncategorizedItemsAccount `json:"uncategorized_items,omitempty"` -} - -func (r Report) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(r, "", false) -} - -func (r *Report) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &r, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Report) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Report) GetReportName() *string { - if o == nil { - return nil - } - return o.ReportName -} - -func (o *Report) GetStartDate() *string { - if o == nil { - return nil - } - return o.StartDate -} - -func (o *Report) GetEndDate() string { - if o == nil { - return "" - } - return o.EndDate -} - -func (o *Report) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *Report) GetAssets() BalanceSheetAssetsAccount { - if o == nil { - return BalanceSheetAssetsAccount{} - } - return o.Assets -} - -func (o *Report) GetLiabilities() BalanceSheetLiabilitiesAccount { - if o == nil { - return BalanceSheetLiabilitiesAccount{} - } - return o.Liabilities -} - -func (o *Report) GetEquity() BalanceSheetEquityAccount { - if o == nil { - return BalanceSheetEquityAccount{} - } - return o.Equity -} - -func (o *Report) GetNetAssets() *float64 { - if o == nil { - return nil - } - return o.NetAssets -} - -func (o *Report) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Report) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *Report) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *Report) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Report) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Report) GetUncategorizedItems() *BalanceSheetUncategorizedItemsAccount { - if o == nil { - return nil - } - return o.UncategorizedItems -} - -type BalanceSheet struct { - Reports []Report `json:"reports"` -} - -func (o *BalanceSheet) GetReports() []Report { - if o == nil { - return []Report{} - } - return o.Reports -} diff --git a/tests/mockserver/internal/sdk/models/components/balancesheetfilter.go b/tests/mockserver/internal/sdk/models/components/balancesheetfilter.go deleted file mode 100644 index 1e7edd94..00000000 --- a/tests/mockserver/internal/sdk/models/components/balancesheetfilter.go +++ /dev/null @@ -1,79 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// PeriodType - The type of period to include in the resource: month, quarter, year. -type PeriodType string - -const ( - PeriodTypeMonth PeriodType = "month" - PeriodTypeQuarter PeriodType = "quarter" - PeriodTypeYear PeriodType = "year" -) - -func (e PeriodType) ToPointer() *PeriodType { - return &e -} -func (e *PeriodType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "month": - fallthrough - case "quarter": - fallthrough - case "year": - *e = PeriodType(v) - return nil - default: - return fmt.Errorf("invalid value for PeriodType: %v", v) - } -} - -type BalanceSheetFilter struct { - // The start date of the period to include in the resource. - // - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - StartDate *string `queryParam:"name=start_date"` - // The end date of the period to include in the resource. - EndDate *string `queryParam:"name=end_date"` - // The number of periods to include in the resource. - PeriodCount *int64 `queryParam:"name=period_count"` - // The type of period to include in the resource: month, quarter, year. - PeriodType *PeriodType `queryParam:"name=period_type"` -} - -func (o *BalanceSheetFilter) GetStartDate() *string { - if o == nil { - return nil - } - return o.StartDate -} - -func (o *BalanceSheetFilter) GetEndDate() *string { - if o == nil { - return nil - } - return o.EndDate -} - -func (o *BalanceSheetFilter) GetPeriodCount() *int64 { - if o == nil { - return nil - } - return o.PeriodCount -} - -func (o *BalanceSheetFilter) GetPeriodType() *PeriodType { - if o == nil { - return nil - } - return o.PeriodType -} diff --git a/tests/mockserver/internal/sdk/models/components/bankaccount.go b/tests/mockserver/internal/sdk/models/components/bankaccount.go deleted file mode 100644 index 30aa7a72..00000000 --- a/tests/mockserver/internal/sdk/models/components/bankaccount.go +++ /dev/null @@ -1,140 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// AccountType - The type of bank account. -type AccountType string - -const ( - AccountTypeBankAccount AccountType = "bank_account" - AccountTypeCreditCard AccountType = "credit_card" - AccountTypeOther AccountType = "other" -) - -func (e AccountType) ToPointer() *AccountType { - return &e -} -func (e *AccountType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "bank_account": - fallthrough - case "credit_card": - fallthrough - case "other": - *e = AccountType(v) - return nil - default: - return fmt.Errorf("invalid value for AccountType: %v", v) - } -} - -type BankAccount struct { - // The name of the bank - BankName *string `json:"bank_name,omitempty"` - // A bank account number is a number that is tied to your bank account. If you have several bank accounts, such as personal, joint, business (and so on), each account will have a different account number. - AccountNumber *string `json:"account_number,omitempty"` - // The name which you used in opening your bank account. - AccountName *string `json:"account_name,omitempty"` - // The type of bank account. - AccountType *AccountType `json:"account_type,omitempty"` - // The International Bank Account Number (IBAN). - Iban *string `json:"iban,omitempty"` - // The Bank Identifier Code (BIC). - Bic *string `json:"bic,omitempty"` - // A routing number is a nine-digit code used to identify a financial institution in the United States. - RoutingNumber *string `json:"routing_number,omitempty"` - // A BSB is a 6 digit numeric code used for identifying the branch of an Australian or New Zealand bank or financial institution. - BsbNumber *string `json:"bsb_number,omitempty"` - // A branch identifier is a unique identifier for a branch of a bank or financial institution. - BranchIdentifier *string `json:"branch_identifier,omitempty"` - // A bank code is a code assigned by a central bank, a bank supervisory body or a Bankers Association in a country to all its licensed member banks or financial institutions. - BankCode *string `json:"bank_code,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"` -} - -func (o *BankAccount) GetBankName() *string { - if o == nil { - return nil - } - return o.BankName -} - -func (o *BankAccount) GetAccountNumber() *string { - if o == nil { - return nil - } - return o.AccountNumber -} - -func (o *BankAccount) GetAccountName() *string { - if o == nil { - return nil - } - return o.AccountName -} - -func (o *BankAccount) GetAccountType() *AccountType { - if o == nil { - return nil - } - return o.AccountType -} - -func (o *BankAccount) GetIban() *string { - if o == nil { - return nil - } - return o.Iban -} - -func (o *BankAccount) GetBic() *string { - if o == nil { - return nil - } - return o.Bic -} - -func (o *BankAccount) GetRoutingNumber() *string { - if o == nil { - return nil - } - return o.RoutingNumber -} - -func (o *BankAccount) GetBsbNumber() *string { - if o == nil { - return nil - } - return o.BsbNumber -} - -func (o *BankAccount) GetBranchIdentifier() *string { - if o == nil { - return nil - } - return o.BranchIdentifier -} - -func (o *BankAccount) GetBankCode() *string { - if o == nil { - return nil - } - return o.BankCode -} - -func (o *BankAccount) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} diff --git a/tests/mockserver/internal/sdk/models/components/bankfeedaccount.go b/tests/mockserver/internal/sdk/models/components/bankfeedaccount.go deleted file mode 100644 index 80a2bc7c..00000000 --- a/tests/mockserver/internal/sdk/models/components/bankfeedaccount.go +++ /dev/null @@ -1,295 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// BankAccountType - Type of the bank account. -type BankAccountType string - -const ( - BankAccountTypeBank BankAccountType = "bank" - BankAccountTypeCreditCard BankAccountType = "credit_card" -) - -func (e BankAccountType) ToPointer() *BankAccountType { - return &e -} -func (e *BankAccountType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "bank": - fallthrough - case "credit_card": - *e = BankAccountType(v) - return nil - default: - return fmt.Errorf("invalid value for BankAccountType: %v", v) - } -} - -// FeedStatus - Current status of the bank feed. -type FeedStatus string - -const ( - FeedStatusPending FeedStatus = "pending" - FeedStatusRejected FeedStatus = "rejected" -) - -func (e FeedStatus) ToPointer() *FeedStatus { - return &e -} -func (e *FeedStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "pending": - fallthrough - case "rejected": - *e = FeedStatus(v) - return nil - default: - return fmt.Errorf("invalid value for FeedStatus: %v", v) - } -} - -type BankFeedAccount struct { - // A unique identifier for an object. - ID string `json:"id"` - // Type of the bank account. - BankAccountType *BankAccountType `json:"bank_account_type,omitempty"` - // The source account's unique identifier. - SourceAccountID *string `json:"source_account_id,omitempty"` - // The target account's unique identifier in the accounting connector. - TargetAccountID *string `json:"target_account_id,omitempty"` - // Name associated with the target account. - TargetAccountName *string `json:"target_account_name,omitempty"` - // Account number of the destination bank account. - TargetAccountNumber *string `json:"target_account_number,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"` - // Current status of the bank feed. - FeedStatus *FeedStatus `json:"feed_status,omitempty"` - // Country code according to ISO 3166-1 alpha-2. - Country *string `json:"country,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 last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` -} - -func (b BankFeedAccount) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(b, "", false) -} - -func (b *BankFeedAccount) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &b, "", false, false); err != nil { - return err - } - return nil -} - -func (o *BankFeedAccount) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *BankFeedAccount) GetBankAccountType() *BankAccountType { - if o == nil { - return nil - } - return o.BankAccountType -} - -func (o *BankFeedAccount) GetSourceAccountID() *string { - if o == nil { - return nil - } - return o.SourceAccountID -} - -func (o *BankFeedAccount) GetTargetAccountID() *string { - if o == nil { - return nil - } - return o.TargetAccountID -} - -func (o *BankFeedAccount) GetTargetAccountName() *string { - if o == nil { - return nil - } - return o.TargetAccountName -} - -func (o *BankFeedAccount) GetTargetAccountNumber() *string { - if o == nil { - return nil - } - return o.TargetAccountNumber -} - -func (o *BankFeedAccount) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *BankFeedAccount) GetFeedStatus() *FeedStatus { - if o == nil { - return nil - } - return o.FeedStatus -} - -func (o *BankFeedAccount) GetCountry() *string { - if o == nil { - return nil - } - return o.Country -} - -func (o *BankFeedAccount) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *BankFeedAccount) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *BankFeedAccount) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *BankFeedAccount) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *BankFeedAccount) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *BankFeedAccount) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -type BankFeedAccountInput struct { - // Type of the bank account. - BankAccountType *BankAccountType `json:"bank_account_type,omitempty"` - // The source account's unique identifier. - SourceAccountID *string `json:"source_account_id,omitempty"` - // The target account's unique identifier in the accounting connector. - TargetAccountID *string `json:"target_account_id,omitempty"` - // Name associated with the target account. - TargetAccountName *string `json:"target_account_name,omitempty"` - // Account number of the destination bank account. - TargetAccountNumber *string `json:"target_account_number,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"` - // Current status of the bank feed. - FeedStatus *FeedStatus `json:"feed_status,omitempty"` - // Country code according to ISO 3166-1 alpha-2. - Country *string `json:"country,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` -} - -func (o *BankFeedAccountInput) GetBankAccountType() *BankAccountType { - if o == nil { - return nil - } - return o.BankAccountType -} - -func (o *BankFeedAccountInput) GetSourceAccountID() *string { - if o == nil { - return nil - } - return o.SourceAccountID -} - -func (o *BankFeedAccountInput) GetTargetAccountID() *string { - if o == nil { - return nil - } - return o.TargetAccountID -} - -func (o *BankFeedAccountInput) GetTargetAccountName() *string { - if o == nil { - return nil - } - return o.TargetAccountName -} - -func (o *BankFeedAccountInput) GetTargetAccountNumber() *string { - if o == nil { - return nil - } - return o.TargetAccountNumber -} - -func (o *BankFeedAccountInput) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *BankFeedAccountInput) GetFeedStatus() *FeedStatus { - if o == nil { - return nil - } - return o.FeedStatus -} - -func (o *BankFeedAccountInput) GetCountry() *string { - if o == nil { - return nil - } - return o.Country -} - -func (o *BankFeedAccountInput) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} diff --git a/tests/mockserver/internal/sdk/models/components/bankfeedstatement.go b/tests/mockserver/internal/sdk/models/components/bankfeedstatement.go deleted file mode 100644 index 6e126434..00000000 --- a/tests/mockserver/internal/sdk/models/components/bankfeedstatement.go +++ /dev/null @@ -1,400 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// StatementStatus - The current status of the bank feed statement. -type StatementStatus string - -const ( - StatementStatusPending StatementStatus = "pending" - StatementStatusRejected StatementStatus = "rejected" - StatementStatusSuccess StatementStatus = "success" -) - -func (e StatementStatus) ToPointer() *StatementStatus { - return &e -} -func (e *StatementStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "pending": - fallthrough - case "rejected": - fallthrough - case "success": - *e = StatementStatus(v) - return nil - default: - return fmt.Errorf("invalid value for StatementStatus: %v", v) - } -} - -// BankFeedStatementTransactionType - Type of transaction. -type BankFeedStatementTransactionType string - -const ( - BankFeedStatementTransactionTypeCredit BankFeedStatementTransactionType = "credit" - BankFeedStatementTransactionTypeDebit BankFeedStatementTransactionType = "debit" - BankFeedStatementTransactionTypeDeposit BankFeedStatementTransactionType = "deposit" - BankFeedStatementTransactionTypeTransfer BankFeedStatementTransactionType = "transfer" - BankFeedStatementTransactionTypePayment BankFeedStatementTransactionType = "payment" - BankFeedStatementTransactionTypeOther BankFeedStatementTransactionType = "other" -) - -func (e BankFeedStatementTransactionType) ToPointer() *BankFeedStatementTransactionType { - return &e -} -func (e *BankFeedStatementTransactionType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "credit": - fallthrough - case "debit": - fallthrough - case "deposit": - fallthrough - case "transfer": - fallthrough - case "payment": - fallthrough - case "other": - *e = BankFeedStatementTransactionType(v) - return nil - default: - return fmt.Errorf("invalid value for BankFeedStatementTransactionType: %v", v) - } -} - -type Transaction struct { - // The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD - PostedDate time.Time `json:"posted_date"` - // A description of the transaction. - Description *string `json:"description,omitempty"` - // The amount of the transaction. - Amount float64 `json:"amount"` - // Whether the amount is a credit or debit. - CreditOrDebit CreditOrDebit `json:"credit_or_debit"` - // The ID of the source transaction. - SourceTransactionID string `json:"source_transaction_id"` - // The counterparty of the transaction. - Counterparty *string `json:"counterparty,omitempty"` - // The reference of the transaction. - Reference *string `json:"reference,omitempty"` - // Type of transaction. - TransactionType *BankFeedStatementTransactionType `json:"transaction_type,omitempty"` -} - -func (t Transaction) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(t, "", false) -} - -func (t *Transaction) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Transaction) GetPostedDate() time.Time { - if o == nil { - return time.Time{} - } - return o.PostedDate -} - -func (o *Transaction) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *Transaction) GetAmount() float64 { - if o == nil { - return 0.0 - } - return o.Amount -} - -func (o *Transaction) GetCreditOrDebit() CreditOrDebit { - if o == nil { - return CreditOrDebit("") - } - return o.CreditOrDebit -} - -func (o *Transaction) GetSourceTransactionID() string { - if o == nil { - return "" - } - return o.SourceTransactionID -} - -func (o *Transaction) GetCounterparty() *string { - if o == nil { - return nil - } - return o.Counterparty -} - -func (o *Transaction) GetReference() *string { - if o == nil { - return nil - } - return o.Reference -} - -func (o *Transaction) GetTransactionType() *BankFeedStatementTransactionType { - if o == nil { - return nil - } - return o.TransactionType -} - -type BankFeedStatement struct { - // A unique identifier for an object. - ID string `json:"id"` - // The ID of the bank feed account this statement belongs to. - BankFeedAccountID *string `json:"bank_feed_account_id,omitempty"` - // The current status of the bank feed statement. - Status *StatementStatus `json:"status,omitempty"` - // Start date of the bank feed statement. - StartDate *time.Time `json:"start_date,omitempty"` - // End date of the bank feed statement. - EndDate *time.Time `json:"end_date,omitempty"` - // Balance amount at the start of the period. - StartBalance *float64 `json:"start_balance,omitempty"` - // Whether the amount is a credit or debit. - StartBalanceCreditOrDebit *CreditOrDebit `json:"start_balance_credit_or_debit,omitempty"` - // Balance amount at the end of the period. - EndBalance *float64 `json:"end_balance,omitempty"` - // Whether the amount is a credit or debit. - EndBalanceCreditOrDebit *CreditOrDebit `json:"end_balance_credit_or_debit,omitempty"` - // List of transactions in the bank feed statement. - Transactions []Transaction `json:"transactions,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` -} - -func (b BankFeedStatement) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(b, "", false) -} - -func (b *BankFeedStatement) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &b, "", false, false); err != nil { - return err - } - return nil -} - -func (o *BankFeedStatement) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *BankFeedStatement) GetBankFeedAccountID() *string { - if o == nil { - return nil - } - return o.BankFeedAccountID -} - -func (o *BankFeedStatement) GetStatus() *StatementStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *BankFeedStatement) GetStartDate() *time.Time { - if o == nil { - return nil - } - return o.StartDate -} - -func (o *BankFeedStatement) GetEndDate() *time.Time { - if o == nil { - return nil - } - return o.EndDate -} - -func (o *BankFeedStatement) GetStartBalance() *float64 { - if o == nil { - return nil - } - return o.StartBalance -} - -func (o *BankFeedStatement) GetStartBalanceCreditOrDebit() *CreditOrDebit { - if o == nil { - return nil - } - return o.StartBalanceCreditOrDebit -} - -func (o *BankFeedStatement) GetEndBalance() *float64 { - if o == nil { - return nil - } - return o.EndBalance -} - -func (o *BankFeedStatement) GetEndBalanceCreditOrDebit() *CreditOrDebit { - if o == nil { - return nil - } - return o.EndBalanceCreditOrDebit -} - -func (o *BankFeedStatement) GetTransactions() []Transaction { - if o == nil { - return nil - } - return o.Transactions -} - -func (o *BankFeedStatement) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *BankFeedStatement) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *BankFeedStatement) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *BankFeedStatement) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -type BankFeedStatementInput struct { - // The ID of the bank feed account this statement belongs to. - BankFeedAccountID *string `json:"bank_feed_account_id,omitempty"` - // The current status of the bank feed statement. - Status *StatementStatus `json:"status,omitempty"` - // Start date of the bank feed statement. - StartDate *time.Time `json:"start_date,omitempty"` - // End date of the bank feed statement. - EndDate *time.Time `json:"end_date,omitempty"` - // Balance amount at the start of the period. - StartBalance *float64 `json:"start_balance,omitempty"` - // Whether the amount is a credit or debit. - StartBalanceCreditOrDebit *CreditOrDebit `json:"start_balance_credit_or_debit,omitempty"` - // Balance amount at the end of the period. - EndBalance *float64 `json:"end_balance,omitempty"` - // Whether the amount is a credit or debit. - EndBalanceCreditOrDebit *CreditOrDebit `json:"end_balance_credit_or_debit,omitempty"` - // List of transactions in the bank feed statement. - Transactions []Transaction `json:"transactions,omitempty"` -} - -func (b BankFeedStatementInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(b, "", false) -} - -func (b *BankFeedStatementInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &b, "", false, false); err != nil { - return err - } - return nil -} - -func (o *BankFeedStatementInput) GetBankFeedAccountID() *string { - if o == nil { - return nil - } - return o.BankFeedAccountID -} - -func (o *BankFeedStatementInput) GetStatus() *StatementStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *BankFeedStatementInput) GetStartDate() *time.Time { - if o == nil { - return nil - } - return o.StartDate -} - -func (o *BankFeedStatementInput) GetEndDate() *time.Time { - if o == nil { - return nil - } - return o.EndDate -} - -func (o *BankFeedStatementInput) GetStartBalance() *float64 { - if o == nil { - return nil - } - return o.StartBalance -} - -func (o *BankFeedStatementInput) GetStartBalanceCreditOrDebit() *CreditOrDebit { - if o == nil { - return nil - } - return o.StartBalanceCreditOrDebit -} - -func (o *BankFeedStatementInput) GetEndBalance() *float64 { - if o == nil { - return nil - } - return o.EndBalance -} - -func (o *BankFeedStatementInput) GetEndBalanceCreditOrDebit() *CreditOrDebit { - if o == nil { - return nil - } - return o.EndBalanceCreditOrDebit -} - -func (o *BankFeedStatementInput) GetTransactions() []Transaction { - if o == nil { - return nil - } - return o.Transactions -} diff --git a/tests/mockserver/internal/sdk/models/components/benefit.go b/tests/mockserver/internal/sdk/models/components/benefit.go deleted file mode 100644 index 01dc91b8..00000000 --- a/tests/mockserver/internal/sdk/models/components/benefit.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type Benefit struct { - // The name of the benefit. - Name *string `json:"name,omitempty"` - // The amount deducted for benefit. - EmployeeDeduction *float64 `json:"employee_deduction,omitempty"` - // The amount of employer contribution. - EmployerContribution *float64 `json:"employer_contribution,omitempty"` -} - -func (o *Benefit) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *Benefit) GetEmployeeDeduction() *float64 { - if o == nil { - return nil - } - return o.EmployeeDeduction -} - -func (o *Benefit) GetEmployerContribution() *float64 { - if o == nil { - return nil - } - return o.EmployerContribution -} diff --git a/tests/mockserver/internal/sdk/models/components/bill.go b/tests/mockserver/internal/sdk/models/components/bill.go deleted file mode 100644 index 0e6012d2..00000000 --- a/tests/mockserver/internal/sdk/models/components/bill.go +++ /dev/null @@ -1,749 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/types" - "mockserver/internal/sdk/utils" - "time" -) - -// BillStatus - Invoice status -type BillStatus string - -const ( - BillStatusDraft BillStatus = "draft" - BillStatusSubmitted BillStatus = "submitted" - BillStatusAuthorised BillStatus = "authorised" - BillStatusPartiallyPaid BillStatus = "partially_paid" - BillStatusPaid BillStatus = "paid" - BillStatusVoid BillStatus = "void" - BillStatusCredit BillStatus = "credit" - BillStatusDeleted BillStatus = "deleted" -) - -func (e BillStatus) ToPointer() *BillStatus { - return &e -} -func (e *BillStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "draft": - fallthrough - case "submitted": - fallthrough - case "authorised": - fallthrough - case "partially_paid": - fallthrough - case "paid": - fallthrough - case "void": - fallthrough - case "credit": - fallthrough - case "deleted": - *e = BillStatus(v) - return nil - default: - return fmt.Errorf("invalid value for BillStatus: %v", v) - } -} - -type Bill struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The third-party API ID of original entity - DownstreamID *string `json:"downstream_id,omitempty"` - // Reference to supplier bill number - BillNumber *string `json:"bill_number,omitempty"` - // The supplier this entity is linked to. - Supplier *LinkedSupplier `json:"supplier,omitempty"` - // The company or subsidiary id the transaction belongs to - CompanyID *string `json:"company_id,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"` - // Currency Exchange Rate at the time entity was recorded/generated. - CurrencyRate *float64 `json:"currency_rate,omitempty"` - // Amounts are including tax - TaxInclusive *bool `json:"tax_inclusive,omitempty"` - // Date bill was issued - YYYY-MM-DD. - BillDate *types.Date `json:"bill_date,omitempty"` - // The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. - DueDate *types.Date `json:"due_date,omitempty"` - // The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. - PaidDate *types.Date `json:"paid_date,omitempty"` - // A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. - PoNumber *string `json:"po_number,omitempty"` - // Optional reference identifier for the transaction. - Reference *string `json:"reference,omitempty"` - LineItems []BillLineItem `json:"line_items,omitempty"` - // Terms of payment. - Terms *string `json:"terms,omitempty"` - // Balance of bill due. - Balance *float64 `json:"balance,omitempty"` - // Amount of deposit made to this bill. - Deposit *float64 `json:"deposit,omitempty"` - // Sub-total amount, normally before tax. - SubTotal *float64 `json:"sub_total,omitempty"` - // Total tax amount applied to this bill. - TotalTax *float64 `json:"total_tax,omitempty"` - // Total amount of bill, including tax. - Total *float64 `json:"total,omitempty"` - // Applicable tax id/code override if tax is not supplied on a line item basis. - TaxCode *string `json:"tax_code,omitempty"` - Notes *string `json:"notes,omitempty"` - // Invoice status - Status *BillStatus `json:"status,omitempty"` - LedgerAccount *LinkedLedgerAccount `json:"ledger_account,omitempty"` - // Payment method used for the transaction, such as cash, credit card, bank transfer, or check - PaymentMethod *string `json:"payment_method,omitempty"` - // The channel through which the transaction is processed. - Channel *string `json:"channel,omitempty"` - // language code according to ISO 639-1. For the United States - EN - Language *string `json:"language,omitempty"` - // Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. - AccountingByRow *bool `json:"accounting_by_row,omitempty"` - BankAccount *BankAccount `json:"bank_account,omitempty"` - // Discount percentage applied to this transaction. - DiscountPercentage *float64 `json:"discount_percentage,omitempty"` - // URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. - SourceDocumentURL *string `json:"source_document_url,omitempty"` - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,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 pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` - // Accounting period - AccountingPeriod *string `json:"accounting_period,omitempty"` -} - -func (b Bill) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(b, "", false) -} - -func (b *Bill) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &b, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Bill) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Bill) GetDownstreamID() *string { - if o == nil { - return nil - } - return o.DownstreamID -} - -func (o *Bill) GetBillNumber() *string { - if o == nil { - return nil - } - return o.BillNumber -} - -func (o *Bill) GetSupplier() *LinkedSupplier { - if o == nil { - return nil - } - return o.Supplier -} - -func (o *Bill) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *Bill) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *Bill) GetCurrencyRate() *float64 { - if o == nil { - return nil - } - return o.CurrencyRate -} - -func (o *Bill) GetTaxInclusive() *bool { - if o == nil { - return nil - } - return o.TaxInclusive -} - -func (o *Bill) GetBillDate() *types.Date { - if o == nil { - return nil - } - return o.BillDate -} - -func (o *Bill) GetDueDate() *types.Date { - if o == nil { - return nil - } - return o.DueDate -} - -func (o *Bill) GetPaidDate() *types.Date { - if o == nil { - return nil - } - return o.PaidDate -} - -func (o *Bill) GetPoNumber() *string { - if o == nil { - return nil - } - return o.PoNumber -} - -func (o *Bill) GetReference() *string { - if o == nil { - return nil - } - return o.Reference -} - -func (o *Bill) GetLineItems() []BillLineItem { - if o == nil { - return nil - } - return o.LineItems -} - -func (o *Bill) GetTerms() *string { - if o == nil { - return nil - } - return o.Terms -} - -func (o *Bill) GetBalance() *float64 { - if o == nil { - return nil - } - return o.Balance -} - -func (o *Bill) GetDeposit() *float64 { - if o == nil { - return nil - } - return o.Deposit -} - -func (o *Bill) GetSubTotal() *float64 { - if o == nil { - return nil - } - return o.SubTotal -} - -func (o *Bill) GetTotalTax() *float64 { - if o == nil { - return nil - } - return o.TotalTax -} - -func (o *Bill) GetTotal() *float64 { - if o == nil { - return nil - } - return o.Total -} - -func (o *Bill) GetTaxCode() *string { - if o == nil { - return nil - } - return o.TaxCode -} - -func (o *Bill) GetNotes() *string { - if o == nil { - return nil - } - return o.Notes -} - -func (o *Bill) GetStatus() *BillStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *Bill) GetLedgerAccount() *LinkedLedgerAccount { - if o == nil { - return nil - } - return o.LedgerAccount -} - -func (o *Bill) GetPaymentMethod() *string { - if o == nil { - return nil - } - return o.PaymentMethod -} - -func (o *Bill) GetChannel() *string { - if o == nil { - return nil - } - return o.Channel -} - -func (o *Bill) GetLanguage() *string { - if o == nil { - return nil - } - return o.Language -} - -func (o *Bill) GetAccountingByRow() *bool { - if o == nil { - return nil - } - return o.AccountingByRow -} - -func (o *Bill) GetBankAccount() *BankAccount { - if o == nil { - return nil - } - return o.BankAccount -} - -func (o *Bill) GetDiscountPercentage() *float64 { - if o == nil { - return nil - } - return o.DiscountPercentage -} - -func (o *Bill) GetSourceDocumentURL() *string { - if o == nil { - return nil - } - return o.SourceDocumentURL -} - -func (o *Bill) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *Bill) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *Bill) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *Bill) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Bill) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Bill) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *Bill) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *Bill) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Bill) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *Bill) GetAccountingPeriod() *string { - if o == nil { - return nil - } - return o.AccountingPeriod -} - -type BillInput struct { - // Reference to supplier bill number - BillNumber *string `json:"bill_number,omitempty"` - // The supplier this entity is linked to. - Supplier *LinkedSupplierInput `json:"supplier,omitempty"` - // The company or subsidiary id the transaction belongs to - CompanyID *string `json:"company_id,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"` - // Currency Exchange Rate at the time entity was recorded/generated. - CurrencyRate *float64 `json:"currency_rate,omitempty"` - // Amounts are including tax - TaxInclusive *bool `json:"tax_inclusive,omitempty"` - // Date bill was issued - YYYY-MM-DD. - BillDate *types.Date `json:"bill_date,omitempty"` - // The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. - DueDate *types.Date `json:"due_date,omitempty"` - // The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. - PaidDate *types.Date `json:"paid_date,omitempty"` - // A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. - PoNumber *string `json:"po_number,omitempty"` - // Optional reference identifier for the transaction. - Reference *string `json:"reference,omitempty"` - LineItems []BillLineItemInput `json:"line_items,omitempty"` - // Terms of payment. - Terms *string `json:"terms,omitempty"` - // Balance of bill due. - Balance *float64 `json:"balance,omitempty"` - // Amount of deposit made to this bill. - Deposit *float64 `json:"deposit,omitempty"` - // Sub-total amount, normally before tax. - SubTotal *float64 `json:"sub_total,omitempty"` - // Total tax amount applied to this bill. - TotalTax *float64 `json:"total_tax,omitempty"` - // Total amount of bill, including tax. - Total *float64 `json:"total,omitempty"` - // Applicable tax id/code override if tax is not supplied on a line item basis. - TaxCode *string `json:"tax_code,omitempty"` - Notes *string `json:"notes,omitempty"` - // Invoice status - Status *BillStatus `json:"status,omitempty"` - LedgerAccount *LinkedLedgerAccountInput `json:"ledger_account,omitempty"` - // Payment method used for the transaction, such as cash, credit card, bank transfer, or check - PaymentMethod *string `json:"payment_method,omitempty"` - // The channel through which the transaction is processed. - Channel *string `json:"channel,omitempty"` - // language code according to ISO 639-1. For the United States - EN - Language *string `json:"language,omitempty"` - // Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. - AccountingByRow *bool `json:"accounting_by_row,omitempty"` - BankAccount *BankAccount `json:"bank_account,omitempty"` - // Discount percentage applied to this transaction. - DiscountPercentage *float64 `json:"discount_percentage,omitempty"` - // URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. - SourceDocumentURL *string `json:"source_document_url,omitempty"` - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` - // Accounting period - AccountingPeriod *string `json:"accounting_period,omitempty"` -} - -func (b BillInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(b, "", false) -} - -func (b *BillInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &b, "", false, false); err != nil { - return err - } - return nil -} - -func (o *BillInput) GetBillNumber() *string { - if o == nil { - return nil - } - return o.BillNumber -} - -func (o *BillInput) GetSupplier() *LinkedSupplierInput { - if o == nil { - return nil - } - return o.Supplier -} - -func (o *BillInput) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *BillInput) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *BillInput) GetCurrencyRate() *float64 { - if o == nil { - return nil - } - return o.CurrencyRate -} - -func (o *BillInput) GetTaxInclusive() *bool { - if o == nil { - return nil - } - return o.TaxInclusive -} - -func (o *BillInput) GetBillDate() *types.Date { - if o == nil { - return nil - } - return o.BillDate -} - -func (o *BillInput) GetDueDate() *types.Date { - if o == nil { - return nil - } - return o.DueDate -} - -func (o *BillInput) GetPaidDate() *types.Date { - if o == nil { - return nil - } - return o.PaidDate -} - -func (o *BillInput) GetPoNumber() *string { - if o == nil { - return nil - } - return o.PoNumber -} - -func (o *BillInput) GetReference() *string { - if o == nil { - return nil - } - return o.Reference -} - -func (o *BillInput) GetLineItems() []BillLineItemInput { - if o == nil { - return nil - } - return o.LineItems -} - -func (o *BillInput) GetTerms() *string { - if o == nil { - return nil - } - return o.Terms -} - -func (o *BillInput) GetBalance() *float64 { - if o == nil { - return nil - } - return o.Balance -} - -func (o *BillInput) GetDeposit() *float64 { - if o == nil { - return nil - } - return o.Deposit -} - -func (o *BillInput) GetSubTotal() *float64 { - if o == nil { - return nil - } - return o.SubTotal -} - -func (o *BillInput) GetTotalTax() *float64 { - if o == nil { - return nil - } - return o.TotalTax -} - -func (o *BillInput) GetTotal() *float64 { - if o == nil { - return nil - } - return o.Total -} - -func (o *BillInput) GetTaxCode() *string { - if o == nil { - return nil - } - return o.TaxCode -} - -func (o *BillInput) GetNotes() *string { - if o == nil { - return nil - } - return o.Notes -} - -func (o *BillInput) GetStatus() *BillStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *BillInput) GetLedgerAccount() *LinkedLedgerAccountInput { - if o == nil { - return nil - } - return o.LedgerAccount -} - -func (o *BillInput) GetPaymentMethod() *string { - if o == nil { - return nil - } - return o.PaymentMethod -} - -func (o *BillInput) GetChannel() *string { - if o == nil { - return nil - } - return o.Channel -} - -func (o *BillInput) GetLanguage() *string { - if o == nil { - return nil - } - return o.Language -} - -func (o *BillInput) GetAccountingByRow() *bool { - if o == nil { - return nil - } - return o.AccountingByRow -} - -func (o *BillInput) GetBankAccount() *BankAccount { - if o == nil { - return nil - } - return o.BankAccount -} - -func (o *BillInput) GetDiscountPercentage() *float64 { - if o == nil { - return nil - } - return o.DiscountPercentage -} - -func (o *BillInput) GetSourceDocumentURL() *string { - if o == nil { - return nil - } - return o.SourceDocumentURL -} - -func (o *BillInput) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *BillInput) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *BillInput) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *BillInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *BillInput) GetAccountingPeriod() *string { - if o == nil { - return nil - } - return o.AccountingPeriod -} diff --git a/tests/mockserver/internal/sdk/models/components/billlineitem.go b/tests/mockserver/internal/sdk/models/components/billlineitem.go deleted file mode 100644 index fc6da8d3..00000000 --- a/tests/mockserver/internal/sdk/models/components/billlineitem.go +++ /dev/null @@ -1,434 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// BillLineItemType - Bill Line Item type -type BillLineItemType string - -const ( - BillLineItemTypeExpenseItem BillLineItemType = "expense_item" - BillLineItemTypeExpenseAccount BillLineItemType = "expense_account" - BillLineItemTypeOther BillLineItemType = "other" -) - -func (e BillLineItemType) ToPointer() *BillLineItemType { - return &e -} -func (e *BillLineItemType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "expense_item": - fallthrough - case "expense_account": - fallthrough - case "other": - *e = BillLineItemType(v) - return nil - default: - return fmt.Errorf("invalid value for BillLineItemType: %v", v) - } -} - -type BillLineItem struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // Row ID - RowID *string `json:"row_id,omitempty"` - // User defined item code - Code *string `json:"code,omitempty"` - // Line number in the invoice - LineNumber *int64 `json:"line_number,omitempty"` - // User defined description - Description *string `json:"description,omitempty"` - // Bill Line Item type - Type *BillLineItemType `json:"type,omitempty"` - // Tax amount - TaxAmount *float64 `json:"tax_amount,omitempty"` - // Total amount of the line item - TotalAmount *float64 `json:"total_amount,omitempty"` - Quantity *float64 `json:"quantity,omitempty"` - UnitPrice *float64 `json:"unit_price,omitempty"` - // Description of the unit type the item is sold as, ie: kg, hour. - UnitOfMeasure *string `json:"unit_of_measure,omitempty"` - // Discount percentage applied to the line item when supported downstream. - DiscountPercentage *float64 `json:"discount_percentage,omitempty"` - // Discount amount applied to the line item when supported downstream. - DiscountAmount *float64 `json:"discount_amount,omitempty"` - // The ID of the location - LocationID *string `json:"location_id,omitempty"` - // The ID of the department - DepartmentID *string `json:"department_id,omitempty"` - Item *LinkedInvoiceItem `json:"item,omitempty"` - TaxRate *LinkedTaxRate `json:"tax_rate,omitempty"` - LedgerAccount *LinkedLedgerAccount `json:"ledger_account,omitempty"` - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,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"` -} - -func (b BillLineItem) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(b, "", false) -} - -func (b *BillLineItem) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &b, "", false, false); err != nil { - return err - } - return nil -} - -func (o *BillLineItem) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *BillLineItem) GetRowID() *string { - if o == nil { - return nil - } - return o.RowID -} - -func (o *BillLineItem) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *BillLineItem) GetLineNumber() *int64 { - if o == nil { - return nil - } - return o.LineNumber -} - -func (o *BillLineItem) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *BillLineItem) GetType() *BillLineItemType { - if o == nil { - return nil - } - return o.Type -} - -func (o *BillLineItem) GetTaxAmount() *float64 { - if o == nil { - return nil - } - return o.TaxAmount -} - -func (o *BillLineItem) GetTotalAmount() *float64 { - if o == nil { - return nil - } - return o.TotalAmount -} - -func (o *BillLineItem) GetQuantity() *float64 { - if o == nil { - return nil - } - return o.Quantity -} - -func (o *BillLineItem) GetUnitPrice() *float64 { - if o == nil { - return nil - } - return o.UnitPrice -} - -func (o *BillLineItem) GetUnitOfMeasure() *string { - if o == nil { - return nil - } - return o.UnitOfMeasure -} - -func (o *BillLineItem) GetDiscountPercentage() *float64 { - if o == nil { - return nil - } - return o.DiscountPercentage -} - -func (o *BillLineItem) GetDiscountAmount() *float64 { - if o == nil { - return nil - } - return o.DiscountAmount -} - -func (o *BillLineItem) GetLocationID() *string { - if o == nil { - return nil - } - return o.LocationID -} - -func (o *BillLineItem) GetDepartmentID() *string { - if o == nil { - return nil - } - return o.DepartmentID -} - -func (o *BillLineItem) GetItem() *LinkedInvoiceItem { - if o == nil { - return nil - } - return o.Item -} - -func (o *BillLineItem) GetTaxRate() *LinkedTaxRate { - if o == nil { - return nil - } - return o.TaxRate -} - -func (o *BillLineItem) GetLedgerAccount() *LinkedLedgerAccount { - if o == nil { - return nil - } - return o.LedgerAccount -} - -func (o *BillLineItem) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *BillLineItem) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *BillLineItem) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *BillLineItem) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *BillLineItem) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *BillLineItem) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -type BillLineItemInput struct { - // Row ID - RowID *string `json:"row_id,omitempty"` - // User defined item code - Code *string `json:"code,omitempty"` - // Line number in the invoice - LineNumber *int64 `json:"line_number,omitempty"` - // User defined description - Description *string `json:"description,omitempty"` - // Bill Line Item type - Type *BillLineItemType `json:"type,omitempty"` - // Tax amount - TaxAmount *float64 `json:"tax_amount,omitempty"` - // Total amount of the line item - TotalAmount *float64 `json:"total_amount,omitempty"` - Quantity *float64 `json:"quantity,omitempty"` - UnitPrice *float64 `json:"unit_price,omitempty"` - // Description of the unit type the item is sold as, ie: kg, hour. - UnitOfMeasure *string `json:"unit_of_measure,omitempty"` - // Discount percentage applied to the line item when supported downstream. - DiscountPercentage *float64 `json:"discount_percentage,omitempty"` - // Discount amount applied to the line item when supported downstream. - DiscountAmount *float64 `json:"discount_amount,omitempty"` - // The ID of the location - LocationID *string `json:"location_id,omitempty"` - // The ID of the department - DepartmentID *string `json:"department_id,omitempty"` - Item *LinkedInvoiceItem `json:"item,omitempty"` - TaxRate *LinkedTaxRateInput `json:"tax_rate,omitempty"` - LedgerAccount *LinkedLedgerAccountInput `json:"ledger_account,omitempty"` - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` -} - -func (o *BillLineItemInput) GetRowID() *string { - if o == nil { - return nil - } - return o.RowID -} - -func (o *BillLineItemInput) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *BillLineItemInput) GetLineNumber() *int64 { - if o == nil { - return nil - } - return o.LineNumber -} - -func (o *BillLineItemInput) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *BillLineItemInput) GetType() *BillLineItemType { - if o == nil { - return nil - } - return o.Type -} - -func (o *BillLineItemInput) GetTaxAmount() *float64 { - if o == nil { - return nil - } - return o.TaxAmount -} - -func (o *BillLineItemInput) GetTotalAmount() *float64 { - if o == nil { - return nil - } - return o.TotalAmount -} - -func (o *BillLineItemInput) GetQuantity() *float64 { - if o == nil { - return nil - } - return o.Quantity -} - -func (o *BillLineItemInput) GetUnitPrice() *float64 { - if o == nil { - return nil - } - return o.UnitPrice -} - -func (o *BillLineItemInput) GetUnitOfMeasure() *string { - if o == nil { - return nil - } - return o.UnitOfMeasure -} - -func (o *BillLineItemInput) GetDiscountPercentage() *float64 { - if o == nil { - return nil - } - return o.DiscountPercentage -} - -func (o *BillLineItemInput) GetDiscountAmount() *float64 { - if o == nil { - return nil - } - return o.DiscountAmount -} - -func (o *BillLineItemInput) GetLocationID() *string { - if o == nil { - return nil - } - return o.LocationID -} - -func (o *BillLineItemInput) GetDepartmentID() *string { - if o == nil { - return nil - } - return o.DepartmentID -} - -func (o *BillLineItemInput) GetItem() *LinkedInvoiceItem { - if o == nil { - return nil - } - return o.Item -} - -func (o *BillLineItemInput) GetTaxRate() *LinkedTaxRateInput { - if o == nil { - return nil - } - return o.TaxRate -} - -func (o *BillLineItemInput) GetLedgerAccount() *LinkedLedgerAccountInput { - if o == nil { - return nil - } - return o.LedgerAccount -} - -func (o *BillLineItemInput) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *BillLineItemInput) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} diff --git a/tests/mockserver/internal/sdk/models/components/billpayment.go b/tests/mockserver/internal/sdk/models/components/billpayment.go deleted file mode 100644 index 3b3b2cab..00000000 --- a/tests/mockserver/internal/sdk/models/components/billpayment.go +++ /dev/null @@ -1,652 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// BillPaymentType - Type of payment -type BillPaymentType string - -const ( - BillPaymentTypeAccountsPayableCredit BillPaymentType = "accounts_payable_credit" - BillPaymentTypeAccountsPayableOverpayment BillPaymentType = "accounts_payable_overpayment" - BillPaymentTypeAccountsPayablePrepayment BillPaymentType = "accounts_payable_prepayment" - BillPaymentTypeAccountsPayable BillPaymentType = "accounts_payable" -) - -func (e BillPaymentType) ToPointer() *BillPaymentType { - return &e -} -func (e *BillPaymentType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "accounts_payable_credit": - fallthrough - case "accounts_payable_overpayment": - fallthrough - case "accounts_payable_prepayment": - fallthrough - case "accounts_payable": - *e = BillPaymentType(v) - return nil - default: - return fmt.Errorf("invalid value for BillPaymentType: %v", v) - } -} - -// BillPaymentAllocationType - Type of entity this payment should be attributed to. -type BillPaymentAllocationType string - -const ( - BillPaymentAllocationTypeBill BillPaymentAllocationType = "bill" - BillPaymentAllocationTypeExpense BillPaymentAllocationType = "expense" - BillPaymentAllocationTypeCreditMemo BillPaymentAllocationType = "credit_memo" - BillPaymentAllocationTypeOverPayment BillPaymentAllocationType = "over_payment" - BillPaymentAllocationTypePrePayment BillPaymentAllocationType = "pre_payment" - BillPaymentAllocationTypeJournalEntry BillPaymentAllocationType = "journal_entry" - BillPaymentAllocationTypeOther BillPaymentAllocationType = "other" -) - -func (e BillPaymentAllocationType) ToPointer() *BillPaymentAllocationType { - return &e -} -func (e *BillPaymentAllocationType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "bill": - fallthrough - case "expense": - fallthrough - case "credit_memo": - fallthrough - case "over_payment": - fallthrough - case "pre_payment": - fallthrough - case "journal_entry": - fallthrough - case "other": - *e = BillPaymentAllocationType(v) - return nil - default: - return fmt.Errorf("invalid value for BillPaymentAllocationType: %v", v) - } -} - -type BillPaymentAllocation struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // Type of entity this payment should be attributed to. - Type *BillPaymentAllocationType `json:"type,omitempty"` - Code *string `json:"code,omitempty"` - // Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. - Amount *float64 `json:"amount,omitempty"` - // Unique identifier of the allocation - AllocationID *string `json:"allocation_id,omitempty"` -} - -func (o *BillPaymentAllocation) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *BillPaymentAllocation) GetType() *BillPaymentAllocationType { - if o == nil { - return nil - } - return o.Type -} - -func (o *BillPaymentAllocation) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *BillPaymentAllocation) GetAmount() *float64 { - if o == nil { - return nil - } - return o.Amount -} - -func (o *BillPaymentAllocation) GetAllocationID() *string { - if o == nil { - return nil - } - return o.AllocationID -} - -type BillPayment struct { - // A unique identifier for an object. - ID string `json:"id"` - // The third-party API ID of original entity - DownstreamID *string `json:"downstream_id,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"` - // Currency Exchange Rate at the time entity was recorded/generated. - CurrencyRate *float64 `json:"currency_rate,omitempty"` - // The total amount of the transaction or record - TotalAmount *float64 `json:"total_amount"` - // Optional transaction reference message ie: Debit remittance detail. - Reference *string `json:"reference,omitempty"` - // Payment method used for the transaction, such as cash, credit card, bank transfer, or check - PaymentMethod *string `json:"payment_method,omitempty"` - // Optional reference message returned by payment method on processing - PaymentMethodReference *string `json:"payment_method_reference,omitempty"` - // A unique identifier for an object. - PaymentMethodID *string `json:"payment_method_id,omitempty"` - Account *LinkedLedgerAccount `json:"account,omitempty"` - // The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD - TransactionDate *time.Time `json:"transaction_date"` - // The supplier this entity is linked to. - Supplier *LinkedSupplier `json:"supplier,omitempty"` - // The company or subsidiary id the transaction belongs to - CompanyID *string `json:"company_id,omitempty"` - // Indicates if the transaction has been reconciled. - Reconciled *bool `json:"reconciled,omitempty"` - // Status of payment - Status *PaymentStatus `json:"status,omitempty"` - // Type of payment - Type *BillPaymentType `json:"type,omitempty"` - Allocations []BillPaymentAllocation `json:"allocations,omitempty"` - // Note associated with the transaction - Note *string `json:"note,omitempty"` - // Number associated with the transaction - Number *string `json:"number,omitempty"` - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // Id to be displayed. - DisplayID *string `json:"display_id,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,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 pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (b BillPayment) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(b, "", false) -} - -func (b *BillPayment) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &b, "", false, false); err != nil { - return err - } - return nil -} - -func (o *BillPayment) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *BillPayment) GetDownstreamID() *string { - if o == nil { - return nil - } - return o.DownstreamID -} - -func (o *BillPayment) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *BillPayment) GetCurrencyRate() *float64 { - if o == nil { - return nil - } - return o.CurrencyRate -} - -func (o *BillPayment) GetTotalAmount() *float64 { - if o == nil { - return nil - } - return o.TotalAmount -} - -func (o *BillPayment) GetReference() *string { - if o == nil { - return nil - } - return o.Reference -} - -func (o *BillPayment) GetPaymentMethod() *string { - if o == nil { - return nil - } - return o.PaymentMethod -} - -func (o *BillPayment) GetPaymentMethodReference() *string { - if o == nil { - return nil - } - return o.PaymentMethodReference -} - -func (o *BillPayment) GetPaymentMethodID() *string { - if o == nil { - return nil - } - return o.PaymentMethodID -} - -func (o *BillPayment) GetAccount() *LinkedLedgerAccount { - if o == nil { - return nil - } - return o.Account -} - -func (o *BillPayment) GetTransactionDate() *time.Time { - if o == nil { - return nil - } - return o.TransactionDate -} - -func (o *BillPayment) GetSupplier() *LinkedSupplier { - if o == nil { - return nil - } - return o.Supplier -} - -func (o *BillPayment) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *BillPayment) GetReconciled() *bool { - if o == nil { - return nil - } - return o.Reconciled -} - -func (o *BillPayment) GetStatus() *PaymentStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *BillPayment) GetType() *BillPaymentType { - if o == nil { - return nil - } - return o.Type -} - -func (o *BillPayment) GetAllocations() []BillPaymentAllocation { - if o == nil { - return nil - } - return o.Allocations -} - -func (o *BillPayment) GetNote() *string { - if o == nil { - return nil - } - return o.Note -} - -func (o *BillPayment) GetNumber() *string { - if o == nil { - return nil - } - return o.Number -} - -func (o *BillPayment) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *BillPayment) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *BillPayment) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *BillPayment) GetDisplayID() *string { - if o == nil { - return nil - } - return o.DisplayID -} - -func (o *BillPayment) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *BillPayment) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *BillPayment) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *BillPayment) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *BillPayment) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *BillPayment) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type BillPaymentAllocationInput struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // Type of entity this payment should be attributed to. - Type *BillPaymentAllocationType `json:"type,omitempty"` - // Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. - Amount *float64 `json:"amount,omitempty"` - // Unique identifier of the allocation - AllocationID *string `json:"allocation_id,omitempty"` -} - -func (o *BillPaymentAllocationInput) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *BillPaymentAllocationInput) GetType() *BillPaymentAllocationType { - if o == nil { - return nil - } - return o.Type -} - -func (o *BillPaymentAllocationInput) GetAmount() *float64 { - if o == nil { - return nil - } - return o.Amount -} - -func (o *BillPaymentAllocationInput) GetAllocationID() *string { - if o == nil { - return nil - } - return o.AllocationID -} - -type BillPaymentInput struct { - // 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"` - // Currency Exchange Rate at the time entity was recorded/generated. - CurrencyRate *float64 `json:"currency_rate,omitempty"` - // The total amount of the transaction or record - TotalAmount *float64 `json:"total_amount"` - // Optional transaction reference message ie: Debit remittance detail. - Reference *string `json:"reference,omitempty"` - // Payment method used for the transaction, such as cash, credit card, bank transfer, or check - PaymentMethod *string `json:"payment_method,omitempty"` - // Optional reference message returned by payment method on processing - PaymentMethodReference *string `json:"payment_method_reference,omitempty"` - // A unique identifier for an object. - PaymentMethodID *string `json:"payment_method_id,omitempty"` - Account *LinkedLedgerAccountInput `json:"account,omitempty"` - // The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD - TransactionDate *time.Time `json:"transaction_date"` - // The supplier this entity is linked to. - Supplier *LinkedSupplierInput `json:"supplier,omitempty"` - // The company or subsidiary id the transaction belongs to - CompanyID *string `json:"company_id,omitempty"` - // Indicates if the transaction has been reconciled. - Reconciled *bool `json:"reconciled,omitempty"` - // Status of payment - Status *PaymentStatus `json:"status,omitempty"` - // Type of payment - Type *BillPaymentType `json:"type,omitempty"` - Allocations []BillPaymentAllocationInput `json:"allocations,omitempty"` - // Note associated with the transaction - Note *string `json:"note,omitempty"` - // Number associated with the transaction - Number *string `json:"number,omitempty"` - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // Id to be displayed. - DisplayID *string `json:"display_id,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (b BillPaymentInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(b, "", false) -} - -func (b *BillPaymentInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &b, "", false, false); err != nil { - return err - } - return nil -} - -func (o *BillPaymentInput) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *BillPaymentInput) GetCurrencyRate() *float64 { - if o == nil { - return nil - } - return o.CurrencyRate -} - -func (o *BillPaymentInput) GetTotalAmount() *float64 { - if o == nil { - return nil - } - return o.TotalAmount -} - -func (o *BillPaymentInput) GetReference() *string { - if o == nil { - return nil - } - return o.Reference -} - -func (o *BillPaymentInput) GetPaymentMethod() *string { - if o == nil { - return nil - } - return o.PaymentMethod -} - -func (o *BillPaymentInput) GetPaymentMethodReference() *string { - if o == nil { - return nil - } - return o.PaymentMethodReference -} - -func (o *BillPaymentInput) GetPaymentMethodID() *string { - if o == nil { - return nil - } - return o.PaymentMethodID -} - -func (o *BillPaymentInput) GetAccount() *LinkedLedgerAccountInput { - if o == nil { - return nil - } - return o.Account -} - -func (o *BillPaymentInput) GetTransactionDate() *time.Time { - if o == nil { - return nil - } - return o.TransactionDate -} - -func (o *BillPaymentInput) GetSupplier() *LinkedSupplierInput { - if o == nil { - return nil - } - return o.Supplier -} - -func (o *BillPaymentInput) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *BillPaymentInput) GetReconciled() *bool { - if o == nil { - return nil - } - return o.Reconciled -} - -func (o *BillPaymentInput) GetStatus() *PaymentStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *BillPaymentInput) GetType() *BillPaymentType { - if o == nil { - return nil - } - return o.Type -} - -func (o *BillPaymentInput) GetAllocations() []BillPaymentAllocationInput { - if o == nil { - return nil - } - return o.Allocations -} - -func (o *BillPaymentInput) GetNote() *string { - if o == nil { - return nil - } - return o.Note -} - -func (o *BillPaymentInput) GetNumber() *string { - if o == nil { - return nil - } - return o.Number -} - -func (o *BillPaymentInput) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *BillPaymentInput) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *BillPaymentInput) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *BillPaymentInput) GetDisplayID() *string { - if o == nil { - return nil - } - return o.DisplayID -} - -func (o *BillPaymentInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/billsfilter.go b/tests/mockserver/internal/sdk/models/components/billsfilter.go deleted file mode 100644 index 6b45cdf7..00000000 --- a/tests/mockserver/internal/sdk/models/components/billsfilter.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type BillsFilter struct { - UpdatedSince *time.Time `queryParam:"name=updated_since"` -} - -func (b BillsFilter) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(b, "", false) -} - -func (b *BillsFilter) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &b, "", false, false); err != nil { - return err - } - return nil -} - -func (o *BillsFilter) GetUpdatedSince() *time.Time { - if o == nil { - return nil - } - return o.UpdatedSince -} diff --git a/tests/mockserver/internal/sdk/models/components/billssort.go b/tests/mockserver/internal/sdk/models/components/billssort.go deleted file mode 100644 index 4dfdeb58..00000000 --- a/tests/mockserver/internal/sdk/models/components/billssort.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// BillsSortBy - The field on which to sort the Bills -type BillsSortBy string - -const ( - BillsSortByUpdatedAt BillsSortBy = "updated_at" - BillsSortByCreatedAt BillsSortBy = "created_at" -) - -func (e BillsSortBy) ToPointer() *BillsSortBy { - return &e -} -func (e *BillsSortBy) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "updated_at": - fallthrough - case "created_at": - *e = BillsSortBy(v) - return nil - default: - return fmt.Errorf("invalid value for BillsSortBy: %v", v) - } -} - -type BillsSort struct { - // The field on which to sort the Bills - By *BillsSortBy `queryParam:"name=by"` - // The direction in which to sort the results - Direction *SortDirection `default:"asc" queryParam:"name=direction"` -} - -func (b BillsSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(b, "", false) -} - -func (b *BillsSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &b, "", false, false); err != nil { - return err - } - return nil -} - -func (o *BillsSort) GetBy() *BillsSortBy { - if o == nil { - return nil - } - return o.By -} - -func (o *BillsSort) GetDirection() *SortDirection { - if o == nil { - return nil - } - return o.Direction -} diff --git a/tests/mockserver/internal/sdk/models/components/category.go b/tests/mockserver/internal/sdk/models/components/category.go deleted file mode 100644 index db52783d..00000000 --- a/tests/mockserver/internal/sdk/models/components/category.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// CategoryStatus - Based on the status some functionality is enabled or disabled. -type CategoryStatus string - -const ( - CategoryStatusActive CategoryStatus = "active" - CategoryStatusInactive CategoryStatus = "inactive" -) - -func (e CategoryStatus) ToPointer() *CategoryStatus { - return &e -} -func (e *CategoryStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "active": - fallthrough - case "inactive": - *e = CategoryStatus(v) - return nil - default: - return fmt.Errorf("invalid value for CategoryStatus: %v", v) - } -} - -type Category struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The name of the category. - Name *string `json:"name,omitempty"` - // Based on the status some functionality is enabled or disabled. - Status *CategoryStatus `json:"status,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (c Category) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *Category) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Category) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Category) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *Category) GetStatus() *CategoryStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *Category) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Category) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *Category) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *Category) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *Category) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Category) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Category) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/collection.go b/tests/mockserver/internal/sdk/models/components/collection.go deleted file mode 100644 index 5e54ab8d..00000000 --- a/tests/mockserver/internal/sdk/models/components/collection.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type Collection struct { - // A unique identifier for an object. - ID string `json:"id"` - // The collections's parent ID - ParentID *string `json:"parent_id,omitempty"` - // The collections's type - Type *string `json:"type,omitempty"` - // Name of the collection - Name *string `json:"name,omitempty"` - // Description of the collection - Description *string `json:"description,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 last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` -} - -func (c Collection) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *Collection) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Collection) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *Collection) GetParentID() *string { - if o == nil { - return nil - } - return o.ParentID -} - -func (o *Collection) GetType() *string { - if o == nil { - return nil - } - return o.Type -} - -func (o *Collection) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *Collection) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *Collection) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Collection) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Collection) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} diff --git a/tests/mockserver/internal/sdk/models/components/collectionssort.go b/tests/mockserver/internal/sdk/models/components/collectionssort.go deleted file mode 100644 index 807e98f4..00000000 --- a/tests/mockserver/internal/sdk/models/components/collectionssort.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// CollectionsSortBy - The field on which to sort the Collections -type CollectionsSortBy string - -const ( - CollectionsSortByName CollectionsSortBy = "name" - CollectionsSortByCreatedAt CollectionsSortBy = "created_at" - CollectionsSortByUpdatedAt CollectionsSortBy = "updated_at" -) - -func (e CollectionsSortBy) ToPointer() *CollectionsSortBy { - return &e -} -func (e *CollectionsSortBy) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "name": - fallthrough - case "created_at": - fallthrough - case "updated_at": - *e = CollectionsSortBy(v) - return nil - default: - return fmt.Errorf("invalid value for CollectionsSortBy: %v", v) - } -} - -type CollectionsSort struct { - // The field on which to sort the Collections - By *CollectionsSortBy `queryParam:"name=by"` - // The direction in which to sort the results - Direction *SortDirection `default:"asc" queryParam:"name=direction"` -} - -func (c CollectionsSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CollectionsSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CollectionsSort) GetBy() *CollectionsSortBy { - if o == nil { - return nil - } - return o.By -} - -func (o *CollectionsSort) GetDirection() *SortDirection { - if o == nil { - return nil - } - return o.Direction -} diff --git a/tests/mockserver/internal/sdk/models/components/collectiontag.go b/tests/mockserver/internal/sdk/models/components/collectiontag.go deleted file mode 100644 index 1b8ae21f..00000000 --- a/tests/mockserver/internal/sdk/models/components/collectiontag.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type CollectionTag struct { - // A unique identifier for an object. - ID *string `json:"id"` - // The name of the tag. - Name *string `json:"name,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` -} - -func (o *CollectionTag) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *CollectionTag) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *CollectionTag) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} diff --git a/tests/mockserver/internal/sdk/models/components/collectiontaginput.go b/tests/mockserver/internal/sdk/models/components/collectiontaginput.go deleted file mode 100644 index 83c5fbea..00000000 --- a/tests/mockserver/internal/sdk/models/components/collectiontaginput.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type CollectionTagInput struct { - // A unique identifier for an object. - ID *string `json:"id"` -} - -func (o *CollectionTagInput) GetID() *string { - if o == nil { - return nil - } - return o.ID -} diff --git a/tests/mockserver/internal/sdk/models/components/collectionticketcomment.go b/tests/mockserver/internal/sdk/models/components/collectionticketcomment.go deleted file mode 100644 index 5a780326..00000000 --- a/tests/mockserver/internal/sdk/models/components/collectionticketcomment.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type CollectionTicketComment struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // Body of the comment - Body *string `json:"body,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (c CollectionTicketComment) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CollectionTicketComment) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CollectionTicketComment) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *CollectionTicketComment) GetBody() *string { - if o == nil { - return nil - } - return o.Body -} - -func (o *CollectionTicketComment) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *CollectionTicketComment) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *CollectionTicketComment) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *CollectionTicketComment) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *CollectionTicketComment) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/collectionticketcommentinput.go b/tests/mockserver/internal/sdk/models/components/collectionticketcommentinput.go deleted file mode 100644 index 8d2f7812..00000000 --- a/tests/mockserver/internal/sdk/models/components/collectionticketcommentinput.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type CollectionTicketCommentInput struct { - // Body of the comment - Body *string `json:"body,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *CollectionTicketCommentInput) GetBody() *string { - if o == nil { - return nil - } - return o.Body -} - -func (o *CollectionTicketCommentInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/collectionuser.go b/tests/mockserver/internal/sdk/models/components/collectionuser.go deleted file mode 100644 index 86d6e98b..00000000 --- a/tests/mockserver/internal/sdk/models/components/collectionuser.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type CollectionUser struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // Full name of the user - Name *string `json:"name,omitempty"` - // First name of the user - FirstName *string `json:"first_name,omitempty"` - // Last name of the user - LastName *string `json:"last_name,omitempty"` - // Email address of the user - Email *string `json:"email,omitempty"` - // The URL of the photo of a person. - PhotoURL *string `json:"photo_url,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 last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` -} - -func (c CollectionUser) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CollectionUser) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CollectionUser) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *CollectionUser) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *CollectionUser) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *CollectionUser) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *CollectionUser) GetEmail() *string { - if o == nil { - return nil - } - return o.Email -} - -func (o *CollectionUser) GetPhotoURL() *string { - if o == nil { - return nil - } - return o.PhotoURL -} - -func (o *CollectionUser) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *CollectionUser) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *CollectionUser) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} diff --git a/tests/mockserver/internal/sdk/models/components/commentssort.go b/tests/mockserver/internal/sdk/models/components/commentssort.go deleted file mode 100644 index 168c23c4..00000000 --- a/tests/mockserver/internal/sdk/models/components/commentssort.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// CommentsSortBy - The field on which to sort the Comments -type CommentsSortBy string - -const ( - CommentsSortByCreatedAt CommentsSortBy = "created_at" - CommentsSortByUpdatedAt CommentsSortBy = "updated_at" -) - -func (e CommentsSortBy) ToPointer() *CommentsSortBy { - return &e -} -func (e *CommentsSortBy) 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 = CommentsSortBy(v) - return nil - default: - return fmt.Errorf("invalid value for CommentsSortBy: %v", v) - } -} - -type CommentsSort struct { - // The field on which to sort the Comments - By *CommentsSortBy `queryParam:"name=by"` - // The direction in which to sort the results - Direction *SortDirection `default:"asc" queryParam:"name=direction"` -} - -func (c CommentsSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CommentsSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CommentsSort) GetBy() *CommentsSortBy { - if o == nil { - return nil - } - return o.By -} - -func (o *CommentsSort) GetDirection() *SortDirection { - if o == nil { - return nil - } - return o.Direction -} diff --git a/tests/mockserver/internal/sdk/models/components/companiesfilter.go b/tests/mockserver/internal/sdk/models/components/companiesfilter.go deleted file mode 100644 index 0aaf5742..00000000 --- a/tests/mockserver/internal/sdk/models/components/companiesfilter.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type CompaniesFilter struct { - // Name of the company to filter on - Name *string `queryParam:"name=name"` -} - -func (o *CompaniesFilter) GetName() *string { - if o == nil { - return nil - } - return o.Name -} diff --git a/tests/mockserver/internal/sdk/models/components/companiessort.go b/tests/mockserver/internal/sdk/models/components/companiessort.go deleted file mode 100644 index 66195b9a..00000000 --- a/tests/mockserver/internal/sdk/models/components/companiessort.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// CompaniesSortBy - The field on which to sort the Companies -type CompaniesSortBy string - -const ( - CompaniesSortByCreatedAt CompaniesSortBy = "created_at" - CompaniesSortByUpdatedAt CompaniesSortBy = "updated_at" - CompaniesSortByName CompaniesSortBy = "name" -) - -func (e CompaniesSortBy) ToPointer() *CompaniesSortBy { - return &e -} -func (e *CompaniesSortBy) 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": - fallthrough - case "name": - *e = CompaniesSortBy(v) - return nil - default: - return fmt.Errorf("invalid value for CompaniesSortBy: %v", v) - } -} - -type CompaniesSort struct { - // The field on which to sort the Companies - By *CompaniesSortBy `queryParam:"name=by"` - // The direction in which to sort the results - Direction *SortDirection `default:"asc" queryParam:"name=direction"` -} - -func (c CompaniesSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CompaniesSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CompaniesSort) GetBy() *CompaniesSortBy { - if o == nil { - return nil - } - return o.By -} - -func (o *CompaniesSort) GetDirection() *SortDirection { - if o == nil { - return nil - } - return o.Direction -} diff --git a/tests/mockserver/internal/sdk/models/components/company.go b/tests/mockserver/internal/sdk/models/components/company.go deleted file mode 100644 index 535c4eeb..00000000 --- a/tests/mockserver/internal/sdk/models/components/company.go +++ /dev/null @@ -1,704 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/types" - "mockserver/internal/sdk/utils" - "time" -) - -type CompanyRowType struct { - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` -} - -func (o *CompanyRowType) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *CompanyRowType) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -type Company struct { - // Unique identifier for the company - ID *string `json:"id,omitempty"` - // Name of the company - Name *string `json:"name"` - // Number of interactions - InteractionCount *int64 `json:"interaction_count,omitempty"` - // Owner ID - OwnerID *string `json:"owner_id,omitempty"` - // The Image URL of the company - Image *string `json:"image,omitempty"` - // A description of the company - Description *string `json:"description,omitempty"` - // The VAT number of the company - VatNumber *string `json:"vat_number,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 status of the company - Status *string `json:"status,omitempty"` - // The fax number of the company - Fax *string `json:"fax,omitempty"` - // The annual revenue of the company - AnnualRevenue *string `json:"annual_revenue,omitempty"` - // Number of employees - NumberOfEmployees *string `json:"number_of_employees,omitempty"` - // The industry represents the type of business the company is in. - Industry *string `json:"industry,omitempty"` - // The ownership indicates the type of ownership of the company. - Ownership *string `json:"ownership,omitempty"` - // A sales tax number is a unique number that identifies a company for tax purposes. - SalesTaxNumber *string `json:"sales_tax_number,omitempty"` - // A payee number is a unique number that identifies a payee for tax purposes. - PayeeNumber *string `json:"payee_number,omitempty"` - // An ABN is necessary for operating a business, while a TFN (Tax File Number) is required for any person working in Australia. - AbnOrTfn *string `json:"abn_or_tfn,omitempty"` - // An ABN Branch (also known as a GST Branch) is used if part of your business needs to account for GST separately from its parent entity. - AbnBranch *string `json:"abn_branch,omitempty"` - // The Australian Company Number (ACN) is a nine digit number with the last digit being a check digit calculated using a modified modulus 10 calculation. ASIC has adopted a convention of always printing and displaying the ACN in the format XXX XXX XXX; three blocks of three characters, each block separated by a blank. - Acn *string `json:"acn,omitempty"` - // The first name of the person. - FirstName *string `json:"first_name,omitempty"` - // The last name of the person. - LastName *string `json:"last_name,omitempty"` - // Parent ID - ParentID *string `json:"parent_id,omitempty"` - BankAccounts []BankAccount `json:"bank_accounts,omitempty"` - Websites []Website `json:"websites,omitempty"` - Addresses []Address `json:"addresses,omitempty"` - SocialLinks []SocialLink `json:"social_links,omitempty"` - PhoneNumbers []PhoneNumber `json:"phone_numbers,omitempty"` - Emails []Email `json:"emails,omitempty"` - RowType *CompanyRowType `json:"row_type,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - Tags []string `json:"tags,omitempty"` - // Whether the company is read-only or not - ReadOnly *bool `json:"read_only,omitempty"` - // Last activity date - LastActivityAt *time.Time `json:"last_activity_at,omitempty"` - // Whether the company is deleted or not - Deleted *bool `json:"deleted,omitempty"` - // A formal salutation for the person. For example, 'Mr', 'Mrs' - Salutation *string `json:"salutation,omitempty"` - // The date of birth of the person. - Birthday *types.Date `json:"birthday,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // Updated by user ID - UpdatedBy *string `json:"updated_by,omitempty"` - // Created by user ID - CreatedBy *string `json:"created_by,omitempty"` - // Last updated date - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // Creation date - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (c Company) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *Company) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Company) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Company) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *Company) GetInteractionCount() *int64 { - if o == nil { - return nil - } - return o.InteractionCount -} - -func (o *Company) GetOwnerID() *string { - if o == nil { - return nil - } - return o.OwnerID -} - -func (o *Company) GetImage() *string { - if o == nil { - return nil - } - return o.Image -} - -func (o *Company) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *Company) GetVatNumber() *string { - if o == nil { - return nil - } - return o.VatNumber -} - -func (o *Company) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *Company) GetStatus() *string { - if o == nil { - return nil - } - return o.Status -} - -func (o *Company) GetFax() *string { - if o == nil { - return nil - } - return o.Fax -} - -func (o *Company) GetAnnualRevenue() *string { - if o == nil { - return nil - } - return o.AnnualRevenue -} - -func (o *Company) GetNumberOfEmployees() *string { - if o == nil { - return nil - } - return o.NumberOfEmployees -} - -func (o *Company) GetIndustry() *string { - if o == nil { - return nil - } - return o.Industry -} - -func (o *Company) GetOwnership() *string { - if o == nil { - return nil - } - return o.Ownership -} - -func (o *Company) GetSalesTaxNumber() *string { - if o == nil { - return nil - } - return o.SalesTaxNumber -} - -func (o *Company) GetPayeeNumber() *string { - if o == nil { - return nil - } - return o.PayeeNumber -} - -func (o *Company) GetAbnOrTfn() *string { - if o == nil { - return nil - } - return o.AbnOrTfn -} - -func (o *Company) GetAbnBranch() *string { - if o == nil { - return nil - } - return o.AbnBranch -} - -func (o *Company) GetAcn() *string { - if o == nil { - return nil - } - return o.Acn -} - -func (o *Company) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *Company) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *Company) GetParentID() *string { - if o == nil { - return nil - } - return o.ParentID -} - -func (o *Company) GetBankAccounts() []BankAccount { - if o == nil { - return nil - } - return o.BankAccounts -} - -func (o *Company) GetWebsites() []Website { - if o == nil { - return nil - } - return o.Websites -} - -func (o *Company) GetAddresses() []Address { - if o == nil { - return nil - } - return o.Addresses -} - -func (o *Company) GetSocialLinks() []SocialLink { - if o == nil { - return nil - } - return o.SocialLinks -} - -func (o *Company) GetPhoneNumbers() []PhoneNumber { - if o == nil { - return nil - } - return o.PhoneNumbers -} - -func (o *Company) GetEmails() []Email { - if o == nil { - return nil - } - return o.Emails -} - -func (o *Company) GetRowType() *CompanyRowType { - if o == nil { - return nil - } - return o.RowType -} - -func (o *Company) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *Company) GetTags() []string { - if o == nil { - return nil - } - return o.Tags -} - -func (o *Company) GetReadOnly() *bool { - if o == nil { - return nil - } - return o.ReadOnly -} - -func (o *Company) GetLastActivityAt() *time.Time { - if o == nil { - return nil - } - return o.LastActivityAt -} - -func (o *Company) GetDeleted() *bool { - if o == nil { - return nil - } - return o.Deleted -} - -func (o *Company) GetSalutation() *string { - if o == nil { - return nil - } - return o.Salutation -} - -func (o *Company) GetBirthday() *types.Date { - if o == nil { - return nil - } - return o.Birthday -} - -func (o *Company) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Company) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *Company) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *Company) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Company) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Company) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type CompanyInput struct { - // Name of the company - Name *string `json:"name"` - // Owner ID - OwnerID *string `json:"owner_id,omitempty"` - // The Image URL of the company - Image *string `json:"image,omitempty"` - // A description of the company - Description *string `json:"description,omitempty"` - // The VAT number of the company - VatNumber *string `json:"vat_number,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 status of the company - Status *string `json:"status,omitempty"` - // The fax number of the company - Fax *string `json:"fax,omitempty"` - // The annual revenue of the company - AnnualRevenue *string `json:"annual_revenue,omitempty"` - // Number of employees - NumberOfEmployees *string `json:"number_of_employees,omitempty"` - // The industry represents the type of business the company is in. - Industry *string `json:"industry,omitempty"` - // The ownership indicates the type of ownership of the company. - Ownership *string `json:"ownership,omitempty"` - // A sales tax number is a unique number that identifies a company for tax purposes. - SalesTaxNumber *string `json:"sales_tax_number,omitempty"` - // A payee number is a unique number that identifies a payee for tax purposes. - PayeeNumber *string `json:"payee_number,omitempty"` - // An ABN is necessary for operating a business, while a TFN (Tax File Number) is required for any person working in Australia. - AbnOrTfn *string `json:"abn_or_tfn,omitempty"` - // An ABN Branch (also known as a GST Branch) is used if part of your business needs to account for GST separately from its parent entity. - AbnBranch *string `json:"abn_branch,omitempty"` - // The Australian Company Number (ACN) is a nine digit number with the last digit being a check digit calculated using a modified modulus 10 calculation. ASIC has adopted a convention of always printing and displaying the ACN in the format XXX XXX XXX; three blocks of three characters, each block separated by a blank. - Acn *string `json:"acn,omitempty"` - // The first name of the person. - FirstName *string `json:"first_name,omitempty"` - // The last name of the person. - LastName *string `json:"last_name,omitempty"` - BankAccounts []BankAccount `json:"bank_accounts,omitempty"` - Websites []Website `json:"websites,omitempty"` - Addresses []Address `json:"addresses,omitempty"` - SocialLinks []SocialLink `json:"social_links,omitempty"` - PhoneNumbers []PhoneNumber `json:"phone_numbers,omitempty"` - Emails []Email `json:"emails,omitempty"` - RowType *CompanyRowType `json:"row_type,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - Tags []string `json:"tags,omitempty"` - // Whether the company is read-only or not - ReadOnly *bool `json:"read_only,omitempty"` - // A formal salutation for the person. For example, 'Mr', 'Mrs' - Salutation *string `json:"salutation,omitempty"` - // The date of birth of the person. - Birthday *types.Date `json:"birthday,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (c CompanyInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CompanyInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CompanyInput) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *CompanyInput) GetOwnerID() *string { - if o == nil { - return nil - } - return o.OwnerID -} - -func (o *CompanyInput) GetImage() *string { - if o == nil { - return nil - } - return o.Image -} - -func (o *CompanyInput) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *CompanyInput) GetVatNumber() *string { - if o == nil { - return nil - } - return o.VatNumber -} - -func (o *CompanyInput) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *CompanyInput) GetStatus() *string { - if o == nil { - return nil - } - return o.Status -} - -func (o *CompanyInput) GetFax() *string { - if o == nil { - return nil - } - return o.Fax -} - -func (o *CompanyInput) GetAnnualRevenue() *string { - if o == nil { - return nil - } - return o.AnnualRevenue -} - -func (o *CompanyInput) GetNumberOfEmployees() *string { - if o == nil { - return nil - } - return o.NumberOfEmployees -} - -func (o *CompanyInput) GetIndustry() *string { - if o == nil { - return nil - } - return o.Industry -} - -func (o *CompanyInput) GetOwnership() *string { - if o == nil { - return nil - } - return o.Ownership -} - -func (o *CompanyInput) GetSalesTaxNumber() *string { - if o == nil { - return nil - } - return o.SalesTaxNumber -} - -func (o *CompanyInput) GetPayeeNumber() *string { - if o == nil { - return nil - } - return o.PayeeNumber -} - -func (o *CompanyInput) GetAbnOrTfn() *string { - if o == nil { - return nil - } - return o.AbnOrTfn -} - -func (o *CompanyInput) GetAbnBranch() *string { - if o == nil { - return nil - } - return o.AbnBranch -} - -func (o *CompanyInput) GetAcn() *string { - if o == nil { - return nil - } - return o.Acn -} - -func (o *CompanyInput) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *CompanyInput) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *CompanyInput) GetBankAccounts() []BankAccount { - if o == nil { - return nil - } - return o.BankAccounts -} - -func (o *CompanyInput) GetWebsites() []Website { - if o == nil { - return nil - } - return o.Websites -} - -func (o *CompanyInput) GetAddresses() []Address { - if o == nil { - return nil - } - return o.Addresses -} - -func (o *CompanyInput) GetSocialLinks() []SocialLink { - if o == nil { - return nil - } - return o.SocialLinks -} - -func (o *CompanyInput) GetPhoneNumbers() []PhoneNumber { - if o == nil { - return nil - } - return o.PhoneNumbers -} - -func (o *CompanyInput) GetEmails() []Email { - if o == nil { - return nil - } - return o.Emails -} - -func (o *CompanyInput) GetRowType() *CompanyRowType { - if o == nil { - return nil - } - return o.RowType -} - -func (o *CompanyInput) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *CompanyInput) GetTags() []string { - if o == nil { - return nil - } - return o.Tags -} - -func (o *CompanyInput) GetReadOnly() *bool { - if o == nil { - return nil - } - return o.ReadOnly -} - -func (o *CompanyInput) GetSalutation() *string { - if o == nil { - return nil - } - return o.Salutation -} - -func (o *CompanyInput) GetBirthday() *types.Date { - if o == nil { - return nil - } - return o.Birthday -} - -func (o *CompanyInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/companyinfo.go b/tests/mockserver/internal/sdk/models/components/companyinfo.go deleted file mode 100644 index 5e734ed1..00000000 --- a/tests/mockserver/internal/sdk/models/components/companyinfo.go +++ /dev/null @@ -1,302 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/types" - "mockserver/internal/sdk/utils" - "time" -) - -// CompanyStatus - Based on the status some functionality is enabled or disabled. -type CompanyStatus string - -const ( - CompanyStatusActive CompanyStatus = "active" - CompanyStatusInactive CompanyStatus = "inactive" -) - -func (e CompanyStatus) ToPointer() *CompanyStatus { - return &e -} -func (e *CompanyStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "active": - fallthrough - case "inactive": - *e = CompanyStatus(v) - return nil - default: - return fmt.Errorf("invalid value for CompanyStatus: %v", v) - } -} - -// TheStartMonthOfFiscalYear - The start month of fiscal year. -type TheStartMonthOfFiscalYear string - -const ( - TheStartMonthOfFiscalYearJanuary TheStartMonthOfFiscalYear = "January" - TheStartMonthOfFiscalYearFebruary TheStartMonthOfFiscalYear = "February" - TheStartMonthOfFiscalYearMarch TheStartMonthOfFiscalYear = "March" - TheStartMonthOfFiscalYearApril TheStartMonthOfFiscalYear = "April" - TheStartMonthOfFiscalYearMay TheStartMonthOfFiscalYear = "May" - TheStartMonthOfFiscalYearJune TheStartMonthOfFiscalYear = "June" - TheStartMonthOfFiscalYearJuly TheStartMonthOfFiscalYear = "July" - TheStartMonthOfFiscalYearAugust TheStartMonthOfFiscalYear = "August" - TheStartMonthOfFiscalYearSeptember TheStartMonthOfFiscalYear = "September" - TheStartMonthOfFiscalYearOctober TheStartMonthOfFiscalYear = "October" - TheStartMonthOfFiscalYearNovember TheStartMonthOfFiscalYear = "November" - TheStartMonthOfFiscalYearDecember TheStartMonthOfFiscalYear = "December" -) - -func (e TheStartMonthOfFiscalYear) ToPointer() *TheStartMonthOfFiscalYear { - return &e -} -func (e *TheStartMonthOfFiscalYear) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "January": - fallthrough - case "February": - fallthrough - case "March": - fallthrough - case "April": - fallthrough - case "May": - fallthrough - case "June": - fallthrough - case "July": - fallthrough - case "August": - fallthrough - case "September": - fallthrough - case "October": - fallthrough - case "November": - fallthrough - case "December": - *e = TheStartMonthOfFiscalYear(v) - return nil - default: - return fmt.Errorf("invalid value for TheStartMonthOfFiscalYear: %v", v) - } -} - -type CompanyInfo struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The name of the company. - CompanyName *string `json:"company_name,omitempty"` - // Based on the status some functionality is enabled or disabled. - Status *CompanyStatus `json:"status,omitempty"` - // The legal name of the company - LegalName *string `json:"legal_name,omitempty"` - // country code according to ISO 3166-1 alpha-2. - Country *string `json:"country,omitempty"` - SalesTaxNumber *string `json:"sales_tax_number,omitempty"` - // Whether sales tax is calculated automatically for the company - AutomatedSalesTax *bool `json:"automated_sales_tax,omitempty"` - // Whether sales tax is enabled for the company - SalesTaxEnabled *bool `json:"sales_tax_enabled,omitempty"` - DefaultSalesTax *TaxRate `json:"default_sales_tax,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"` - // language code according to ISO 639-1. For the United States - EN - Language *string `json:"language,omitempty"` - // The start month of fiscal year. - FiscalYearStartMonth *TheStartMonthOfFiscalYear `json:"fiscal_year_start_month,omitempty"` - // Date when company file was created - CompanyStartDate *types.Date `json:"company_start_date,omitempty"` - Addresses []Address `json:"addresses,omitempty"` - PhoneNumbers []PhoneNumber `json:"phone_numbers,omitempty"` - Emails []Email `json:"emails,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` -} - -func (c CompanyInfo) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CompanyInfo) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CompanyInfo) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *CompanyInfo) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *CompanyInfo) GetStatus() *CompanyStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *CompanyInfo) GetLegalName() *string { - if o == nil { - return nil - } - return o.LegalName -} - -func (o *CompanyInfo) GetCountry() *string { - if o == nil { - return nil - } - return o.Country -} - -func (o *CompanyInfo) GetSalesTaxNumber() *string { - if o == nil { - return nil - } - return o.SalesTaxNumber -} - -func (o *CompanyInfo) GetAutomatedSalesTax() *bool { - if o == nil { - return nil - } - return o.AutomatedSalesTax -} - -func (o *CompanyInfo) GetSalesTaxEnabled() *bool { - if o == nil { - return nil - } - return o.SalesTaxEnabled -} - -func (o *CompanyInfo) GetDefaultSalesTax() *TaxRate { - if o == nil { - return nil - } - return o.DefaultSalesTax -} - -func (o *CompanyInfo) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *CompanyInfo) GetLanguage() *string { - if o == nil { - return nil - } - return o.Language -} - -func (o *CompanyInfo) GetFiscalYearStartMonth() *TheStartMonthOfFiscalYear { - if o == nil { - return nil - } - return o.FiscalYearStartMonth -} - -func (o *CompanyInfo) GetCompanyStartDate() *types.Date { - if o == nil { - return nil - } - return o.CompanyStartDate -} - -func (o *CompanyInfo) GetAddresses() []Address { - if o == nil { - return nil - } - return o.Addresses -} - -func (o *CompanyInfo) GetPhoneNumbers() []PhoneNumber { - if o == nil { - return nil - } - return o.PhoneNumbers -} - -func (o *CompanyInfo) GetEmails() []Email { - if o == nil { - return nil - } - return o.Emails -} - -func (o *CompanyInfo) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *CompanyInfo) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *CompanyInfo) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *CompanyInfo) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *CompanyInfo) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *CompanyInfo) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} diff --git a/tests/mockserver/internal/sdk/models/components/compensation.go b/tests/mockserver/internal/sdk/models/components/compensation.go deleted file mode 100644 index 3ab74487..00000000 --- a/tests/mockserver/internal/sdk/models/components/compensation.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type Compensation struct { - // A unique identifier for an object. - EmployeeID *string `json:"employee_id"` - // The employee's net pay. Only available when payroll has been processed - NetPay *float64 `json:"net_pay,omitempty"` - // The employee's gross pay. Only available when payroll has been processed - GrossPay *float64 `json:"gross_pay,omitempty"` - // An array of employer and employee taxes for the pay period. - Taxes []Tax `json:"taxes,omitempty"` - // An array of employee deductions for the pay period. - Deductions []Deduction `json:"deductions,omitempty"` - // An array of employee benefits for the pay period. - Benefits []Benefit `json:"benefits,omitempty"` -} - -func (o *Compensation) GetEmployeeID() *string { - if o == nil { - return nil - } - return o.EmployeeID -} - -func (o *Compensation) GetNetPay() *float64 { - if o == nil { - return nil - } - return o.NetPay -} - -func (o *Compensation) GetGrossPay() *float64 { - if o == nil { - return nil - } - return o.GrossPay -} - -func (o *Compensation) GetTaxes() []Tax { - if o == nil { - return nil - } - return o.Taxes -} - -func (o *Compensation) GetDeductions() []Deduction { - if o == nil { - return nil - } - return o.Deductions -} - -func (o *Compensation) GetBenefits() []Benefit { - if o == nil { - return nil - } - return o.Benefits -} diff --git a/tests/mockserver/internal/sdk/models/components/connection.go b/tests/mockserver/internal/sdk/models/components/connection.go deleted file mode 100644 index 969e552a..00000000 --- a/tests/mockserver/internal/sdk/models/components/connection.go +++ /dev/null @@ -1,699 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "errors" - "fmt" - "mockserver/internal/sdk/utils" -) - -// ConnectionStatus - Status of the connection. -type ConnectionStatus string - -const ( - ConnectionStatusLive ConnectionStatus = "live" - ConnectionStatusUpcoming ConnectionStatus = "upcoming" - ConnectionStatusRequested ConnectionStatus = "requested" -) - -func (e ConnectionStatus) ToPointer() *ConnectionStatus { - return &e -} -func (e *ConnectionStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "live": - fallthrough - case "upcoming": - fallthrough - case "requested": - *e = ConnectionStatus(v) - return nil - default: - return fmt.Errorf("invalid value for ConnectionStatus: %v", v) - } -} - -type Target string - -const ( - TargetCustomFields Target = "custom_fields" - TargetResource Target = "resource" -) - -func (e Target) ToPointer() *Target { - return &e -} -func (e *Target) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "custom_fields": - fallthrough - case "resource": - *e = Target(v) - return nil - default: - return fmt.Errorf("invalid value for Target: %v", v) - } -} - -type ConnectionValue1Type string - -const ( - ConnectionValue1TypeStr ConnectionValue1Type = "str" - ConnectionValue1TypeInteger ConnectionValue1Type = "integer" - ConnectionValue1TypeNumber ConnectionValue1Type = "number" -) - -type ConnectionValue1 struct { - Str *string `queryParam:"inline"` - Integer *int64 `queryParam:"inline"` - Number *float64 `queryParam:"inline"` - - Type ConnectionValue1Type -} - -func CreateConnectionValue1Str(str string) ConnectionValue1 { - typ := ConnectionValue1TypeStr - - return ConnectionValue1{ - Str: &str, - Type: typ, - } -} - -func CreateConnectionValue1Integer(integer int64) ConnectionValue1 { - typ := ConnectionValue1TypeInteger - - return ConnectionValue1{ - Integer: &integer, - Type: typ, - } -} - -func CreateConnectionValue1Number(number float64) ConnectionValue1 { - typ := ConnectionValue1TypeNumber - - return ConnectionValue1{ - Number: &number, - Type: typ, - } -} - -func (u *ConnectionValue1) UnmarshalJSON(data []byte) error { - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = ConnectionValue1TypeStr - return nil - } - - var integer int64 = int64(0) - if err := utils.UnmarshalJSON(data, &integer, "", true, true); err == nil { - u.Integer = &integer - u.Type = ConnectionValue1TypeInteger - return nil - } - - var number float64 = float64(0) - if err := utils.UnmarshalJSON(data, &number, "", true, true); err == nil { - u.Number = &number - u.Type = ConnectionValue1TypeNumber - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for ConnectionValue1", string(data)) -} - -func (u ConnectionValue1) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.Integer != nil { - return utils.MarshalJSON(u.Integer, "", true) - } - - if u.Number != nil { - return utils.MarshalJSON(u.Number, "", true) - } - - return nil, errors.New("could not marshal union type ConnectionValue1: all fields are null") -} - -type ConnectionValue2Type string - -const ( - ConnectionValue2TypeStr ConnectionValue2Type = "str" - ConnectionValue2TypeInteger ConnectionValue2Type = "integer" - ConnectionValue2TypeNumber ConnectionValue2Type = "number" - ConnectionValue2TypeBoolean ConnectionValue2Type = "boolean" - ConnectionValue2TypeArrayOfConnectionValue1 ConnectionValue2Type = "arrayOfConnectionValue1" -) - -type ConnectionValue2 struct { - Str *string `queryParam:"inline"` - Integer *int64 `queryParam:"inline"` - Number *float64 `queryParam:"inline"` - Boolean *bool `queryParam:"inline"` - ArrayOfConnectionValue1 []ConnectionValue1 `queryParam:"inline"` - - Type ConnectionValue2Type -} - -func CreateConnectionValue2Str(str string) ConnectionValue2 { - typ := ConnectionValue2TypeStr - - return ConnectionValue2{ - Str: &str, - Type: typ, - } -} - -func CreateConnectionValue2Integer(integer int64) ConnectionValue2 { - typ := ConnectionValue2TypeInteger - - return ConnectionValue2{ - Integer: &integer, - Type: typ, - } -} - -func CreateConnectionValue2Number(number float64) ConnectionValue2 { - typ := ConnectionValue2TypeNumber - - return ConnectionValue2{ - Number: &number, - Type: typ, - } -} - -func CreateConnectionValue2Boolean(boolean bool) ConnectionValue2 { - typ := ConnectionValue2TypeBoolean - - return ConnectionValue2{ - Boolean: &boolean, - Type: typ, - } -} - -func CreateConnectionValue2ArrayOfConnectionValue1(arrayOfConnectionValue1 []ConnectionValue1) ConnectionValue2 { - typ := ConnectionValue2TypeArrayOfConnectionValue1 - - return ConnectionValue2{ - ArrayOfConnectionValue1: arrayOfConnectionValue1, - Type: typ, - } -} - -func (u *ConnectionValue2) UnmarshalJSON(data []byte) error { - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = ConnectionValue2TypeStr - return nil - } - - var integer int64 = int64(0) - if err := utils.UnmarshalJSON(data, &integer, "", true, true); err == nil { - u.Integer = &integer - u.Type = ConnectionValue2TypeInteger - return nil - } - - var number float64 = float64(0) - if err := utils.UnmarshalJSON(data, &number, "", true, true); err == nil { - u.Number = &number - u.Type = ConnectionValue2TypeNumber - return nil - } - - var boolean bool = false - if err := utils.UnmarshalJSON(data, &boolean, "", true, true); err == nil { - u.Boolean = &boolean - u.Type = ConnectionValue2TypeBoolean - return nil - } - - var arrayOfConnectionValue1 []ConnectionValue1 = []ConnectionValue1{} - if err := utils.UnmarshalJSON(data, &arrayOfConnectionValue1, "", true, true); err == nil { - u.ArrayOfConnectionValue1 = arrayOfConnectionValue1 - u.Type = ConnectionValue2TypeArrayOfConnectionValue1 - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for ConnectionValue2", string(data)) -} - -func (u ConnectionValue2) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.Integer != nil { - return utils.MarshalJSON(u.Integer, "", true) - } - - if u.Number != nil { - return utils.MarshalJSON(u.Number, "", true) - } - - if u.Boolean != nil { - return utils.MarshalJSON(u.Boolean, "", true) - } - - if u.ArrayOfConnectionValue1 != nil { - return utils.MarshalJSON(u.ArrayOfConnectionValue1, "", true) - } - - return nil, errors.New("could not marshal union type ConnectionValue2: all fields are null") -} - -type Default struct { - Target *Target `json:"target,omitempty"` - ID *string `json:"id,omitempty"` - Options []FormFieldOption `json:"options,omitempty"` - Value *ConnectionValue2 `json:"value,omitempty"` -} - -func (o *Default) GetTarget() *Target { - if o == nil { - return nil - } - return o.Target -} - -func (o *Default) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Default) GetOptions() []FormFieldOption { - if o == nil { - return nil - } - return o.Options -} - -func (o *Default) GetValue() *ConnectionValue2 { - if o == nil { - return nil - } - return o.Value -} - -type Configuration struct { - Resource *string `json:"resource,omitempty"` - Defaults []Default `json:"defaults,omitempty"` -} - -func (o *Configuration) GetResource() *string { - if o == nil { - return nil - } - return o.Resource -} - -func (o *Configuration) GetDefaults() []Default { - if o == nil { - return nil - } - return o.Defaults -} - -type Connection struct { - // The unique identifier of the connection. - ID *string `json:"id,omitempty"` - // The ID of the service this connection belongs to. - ServiceID *string `json:"service_id,omitempty"` - // The name of the connection - Name *string `json:"name,omitempty"` - TagLine *string `json:"tag_line,omitempty"` - // The unified API category where the connection belongs to. - UnifiedAPI *string `json:"unified_api,omitempty"` - // [Connection state flow](#section/Connection-state) - State *ConnectionState `json:"state,omitempty"` - // The current state of the Integration. - IntegrationState *IntegrationState `json:"integration_state,omitempty"` - // Type of authorization used by the connector - AuthType *AuthType `json:"auth_type,omitempty"` - // OAuth grant type used by the connector. More info: https://oauth.net/2/grant-types - OauthGrantType *OAuthGrantType `json:"oauth_grant_type,omitempty"` - // Status of the connection. - Status *ConnectionStatus `json:"status,omitempty"` - // Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API. - Enabled *bool `json:"enabled,omitempty"` - // The website URL of the connection - Website *string `json:"website,omitempty"` - // A visual icon of the connection, that will be shown in the Vault - Icon *string `json:"icon,omitempty"` - // The logo of the connection, that will be shown in the Vault - Logo *string `json:"logo,omitempty"` - // The OAuth redirect URI. Redirect your users to this URI to let them authorize your app in the connector's UI. Before you can use this URI, you must add `redirect_uri` as a query parameter to the `authorize_url`. Be sure to URL encode the `redirect_uri` part. Your users will be redirected to this `redirect_uri` after they granted access to your app in the connector's UI. - AuthorizeURL *string `json:"authorize_url,omitempty"` - // The OAuth revoke URI. Redirect your users to this URI to revoke this connection. Before you can use this URI, you must add `redirect_uri` as a query parameter. Your users will be redirected to this `redirect_uri` after they granted access to your app in the connector's UI. - RevokeURL *string `json:"revoke_url,omitempty"` - // Connection settings. Values will persist to `form_fields` with corresponding id - Settings map[string]any `json:"settings,omitempty"` - // Attach your own consumer specific metadata - Metadata map[string]any `json:"metadata,omitempty"` - // The settings that are wanted to create a connection. - FormFields []FormField `json:"form_fields,omitempty"` - Configuration []Configuration `json:"configuration,omitempty"` - ConfigurableResources []string `json:"configurable_resources,omitempty"` - ResourceSchemaSupport []string `json:"resource_schema_support,omitempty"` - ResourceSettingsSupport []string `json:"resource_settings_support,omitempty"` - ValidationSupport *bool `json:"validation_support,omitempty"` - SchemaSupport *bool `json:"schema_support,omitempty"` - // List of settings that are required to be configured on integration before authorization can occur - SettingsRequiredForAuthorization []string `json:"settings_required_for_authorization,omitempty"` - Subscriptions []WebhookSubscription `json:"subscriptions,omitempty"` - // Whether the connector has a guide available in the developer docs or not (https://docs.apideck.com/connectors/{service_id}/docs/consumer+connection). - HasGuide *bool `json:"has_guide,omitempty"` - CreatedAt *float64 `json:"created_at,omitempty"` - // List of custom mappings configured for this connection - CustomMappings []CustomMapping `json:"custom_mappings,omitempty"` - UpdatedAt *float64 `json:"updated_at,omitempty"` -} - -func (o *Connection) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Connection) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *Connection) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *Connection) GetTagLine() *string { - if o == nil { - return nil - } - return o.TagLine -} - -func (o *Connection) GetUnifiedAPI() *string { - if o == nil { - return nil - } - return o.UnifiedAPI -} - -func (o *Connection) GetState() *ConnectionState { - if o == nil { - return nil - } - return o.State -} - -func (o *Connection) GetIntegrationState() *IntegrationState { - if o == nil { - return nil - } - return o.IntegrationState -} - -func (o *Connection) GetAuthType() *AuthType { - if o == nil { - return nil - } - return o.AuthType -} - -func (o *Connection) GetOauthGrantType() *OAuthGrantType { - if o == nil { - return nil - } - return o.OauthGrantType -} - -func (o *Connection) GetStatus() *ConnectionStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *Connection) GetEnabled() *bool { - if o == nil { - return nil - } - return o.Enabled -} - -func (o *Connection) GetWebsite() *string { - if o == nil { - return nil - } - return o.Website -} - -func (o *Connection) GetIcon() *string { - if o == nil { - return nil - } - return o.Icon -} - -func (o *Connection) GetLogo() *string { - if o == nil { - return nil - } - return o.Logo -} - -func (o *Connection) GetAuthorizeURL() *string { - if o == nil { - return nil - } - return o.AuthorizeURL -} - -func (o *Connection) GetRevokeURL() *string { - if o == nil { - return nil - } - return o.RevokeURL -} - -func (o *Connection) GetSettings() map[string]any { - if o == nil { - return nil - } - return o.Settings -} - -func (o *Connection) GetMetadata() map[string]any { - if o == nil { - return nil - } - return o.Metadata -} - -func (o *Connection) GetFormFields() []FormField { - if o == nil { - return nil - } - return o.FormFields -} - -func (o *Connection) GetConfiguration() []Configuration { - if o == nil { - return nil - } - return o.Configuration -} - -func (o *Connection) GetConfigurableResources() []string { - if o == nil { - return nil - } - return o.ConfigurableResources -} - -func (o *Connection) GetResourceSchemaSupport() []string { - if o == nil { - return nil - } - return o.ResourceSchemaSupport -} - -func (o *Connection) GetResourceSettingsSupport() []string { - if o == nil { - return nil - } - return o.ResourceSettingsSupport -} - -func (o *Connection) GetValidationSupport() *bool { - if o == nil { - return nil - } - return o.ValidationSupport -} - -func (o *Connection) GetSchemaSupport() *bool { - if o == nil { - return nil - } - return o.SchemaSupport -} - -func (o *Connection) GetSettingsRequiredForAuthorization() []string { - if o == nil { - return nil - } - return o.SettingsRequiredForAuthorization -} - -func (o *Connection) GetSubscriptions() []WebhookSubscription { - if o == nil { - return nil - } - return o.Subscriptions -} - -func (o *Connection) GetHasGuide() *bool { - if o == nil { - return nil - } - return o.HasGuide -} - -func (o *Connection) GetCreatedAt() *float64 { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Connection) GetCustomMappings() []CustomMapping { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Connection) GetUpdatedAt() *float64 { - if o == nil { - return nil - } - return o.UpdatedAt -} - -type DefaultInput struct { - ID *string `json:"id,omitempty"` - Options []FormFieldOption `json:"options,omitempty"` - Value *ConnectionValue2 `json:"value,omitempty"` -} - -func (o *DefaultInput) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *DefaultInput) GetOptions() []FormFieldOption { - if o == nil { - return nil - } - return o.Options -} - -func (o *DefaultInput) GetValue() *ConnectionValue2 { - if o == nil { - return nil - } - return o.Value -} - -type ConfigurationInput struct { - Resource *string `json:"resource,omitempty"` - Defaults []DefaultInput `json:"defaults,omitempty"` -} - -func (o *ConfigurationInput) GetResource() *string { - if o == nil { - return nil - } - return o.Resource -} - -func (o *ConfigurationInput) GetDefaults() []DefaultInput { - if o == nil { - return nil - } - return o.Defaults -} - -type ConnectionInput struct { - // Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API. - Enabled *bool `json:"enabled,omitempty"` - // Connection settings. Values will persist to `form_fields` with corresponding id - Settings map[string]any `json:"settings,omitempty"` - // Attach your own consumer specific metadata - Metadata map[string]any `json:"metadata,omitempty"` - Configuration []ConfigurationInput `json:"configuration,omitempty"` - // List of custom mappings configured for this connection - CustomMappings []CustomMappingInput `json:"custom_mappings,omitempty"` -} - -func (o *ConnectionInput) GetEnabled() *bool { - if o == nil { - return nil - } - return o.Enabled -} - -func (o *ConnectionInput) GetSettings() map[string]any { - if o == nil { - return nil - } - return o.Settings -} - -func (o *ConnectionInput) GetMetadata() map[string]any { - if o == nil { - return nil - } - return o.Metadata -} - -func (o *ConnectionInput) GetConfiguration() []ConfigurationInput { - if o == nil { - return nil - } - return o.Configuration -} - -func (o *ConnectionInput) GetCustomMappings() []CustomMappingInput { - if o == nil { - return nil - } - return o.CustomMappings -} diff --git a/tests/mockserver/internal/sdk/models/components/connectionimportdata.go b/tests/mockserver/internal/sdk/models/components/connectionimportdata.go deleted file mode 100644 index 4747925f..00000000 --- a/tests/mockserver/internal/sdk/models/components/connectionimportdata.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type Credentials struct { - // The refresh token can be used to obtain a new access token. - RefreshToken *string `json:"refresh_token,omitempty"` - // Access token - AccessToken *string `json:"access_token,omitempty"` - // The datetime at which the token was issued. If omitted the token will be queued for refresh. - IssuedAt *time.Time `json:"issued_at,omitempty"` - // The number of seconds until the token expires. If omitted the token will be queued for refresh. - ExpiresIn *int64 `json:"expires_in,omitempty"` -} - -func (c Credentials) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *Credentials) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Credentials) GetRefreshToken() *string { - if o == nil { - return nil - } - return o.RefreshToken -} - -func (o *Credentials) GetAccessToken() *string { - if o == nil { - return nil - } - return o.AccessToken -} - -func (o *Credentials) GetIssuedAt() *time.Time { - if o == nil { - return nil - } - return o.IssuedAt -} - -func (o *Credentials) GetExpiresIn() *int64 { - if o == nil { - return nil - } - return o.ExpiresIn -} - -type ConnectionImportData struct { - Credentials *Credentials `json:"credentials,omitempty"` - // Connection settings. Values will persist to `form_fields` with corresponding id - Settings map[string]any `json:"settings,omitempty"` - // Attach your own consumer specific metadata - Metadata map[string]any `json:"metadata,omitempty"` -} - -func (o *ConnectionImportData) GetCredentials() *Credentials { - if o == nil { - return nil - } - return o.Credentials -} - -func (o *ConnectionImportData) GetSettings() map[string]any { - if o == nil { - return nil - } - return o.Settings -} - -func (o *ConnectionImportData) GetMetadata() map[string]any { - if o == nil { - return nil - } - return o.Metadata -} diff --git a/tests/mockserver/internal/sdk/models/components/connectionstate.go b/tests/mockserver/internal/sdk/models/components/connectionstate.go deleted file mode 100644 index 4338e93a..00000000 --- a/tests/mockserver/internal/sdk/models/components/connectionstate.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// ConnectionState - [Connection state flow](#section/Connection-state) -type ConnectionState string - -const ( - ConnectionStateAvailable ConnectionState = "available" - ConnectionStateCallable ConnectionState = "callable" - ConnectionStateAdded ConnectionState = "added" - ConnectionStateAuthorized ConnectionState = "authorized" - ConnectionStateInvalid ConnectionState = "invalid" -) - -func (e ConnectionState) ToPointer() *ConnectionState { - return &e -} -func (e *ConnectionState) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "available": - fallthrough - case "callable": - fallthrough - case "added": - fallthrough - case "authorized": - fallthrough - case "invalid": - *e = ConnectionState(v) - return nil - default: - return fmt.Errorf("invalid value for ConnectionState: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/connector.go b/tests/mockserver/internal/sdk/models/components/connector.go deleted file mode 100644 index a6434ac0..00000000 --- a/tests/mockserver/internal/sdk/models/components/connector.go +++ /dev/null @@ -1,490 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// ConnectorAuthType - Type of authorization used by the connector -type ConnectorAuthType string - -const ( - ConnectorAuthTypeOauth2 ConnectorAuthType = "oauth2" - ConnectorAuthTypeAPIKey ConnectorAuthType = "apiKey" - ConnectorAuthTypeBasic ConnectorAuthType = "basic" - ConnectorAuthTypeCustom ConnectorAuthType = "custom" - ConnectorAuthTypeNone ConnectorAuthType = "none" -) - -func (e ConnectorAuthType) ToPointer() *ConnectorAuthType { - return &e -} -func (e *ConnectorAuthType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "oauth2": - fallthrough - case "apiKey": - fallthrough - case "basic": - fallthrough - case "custom": - fallthrough - case "none": - *e = ConnectorAuthType(v) - return nil - default: - return fmt.Errorf("invalid value for ConnectorAuthType: %v", v) - } -} - -// ConnectorOauthGrantType - OAuth grant type used by the connector. More info: https://oauth.net/2/grant-types -type ConnectorOauthGrantType string - -const ( - ConnectorOauthGrantTypeAuthorizationCode ConnectorOauthGrantType = "authorization_code" - ConnectorOauthGrantTypeClientCredentials ConnectorOauthGrantType = "client_credentials" - ConnectorOauthGrantTypePassword ConnectorOauthGrantType = "password" -) - -func (e ConnectorOauthGrantType) ToPointer() *ConnectorOauthGrantType { - return &e -} -func (e *ConnectorOauthGrantType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "authorization_code": - fallthrough - case "client_credentials": - fallthrough - case "password": - *e = ConnectorOauthGrantType(v) - return nil - default: - return fmt.Errorf("invalid value for ConnectorOauthGrantType: %v", v) - } -} - -// OauthCredentialsSource - Location of the OAuth client credentials. For most connectors the OAuth client credentials are stored on integration and managed by the application owner. For others they are stored on connection and managed by the consumer in Vault. -type OauthCredentialsSource string - -const ( - OauthCredentialsSourceIntegration OauthCredentialsSource = "integration" - OauthCredentialsSourceConnection OauthCredentialsSource = "connection" -) - -func (e OauthCredentialsSource) ToPointer() *OauthCredentialsSource { - return &e -} -func (e *OauthCredentialsSource) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "integration": - fallthrough - case "connection": - *e = OauthCredentialsSource(v) - return nil - default: - return fmt.Errorf("invalid value for OauthCredentialsSource: %v", v) - } -} - -type OauthScope struct { - // ID of the OAuth scope. - ID *string `json:"id,omitempty"` - // Label of the OAuth scope. - Label *string `json:"label,omitempty"` - // List of Unified APIs that request this OAuth Scope by default. Application owners can customize the requested scopes. - DefaultApis []string `json:"default_apis,omitempty"` -} - -func (o *OauthScope) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *OauthScope) GetLabel() *string { - if o == nil { - return nil - } - return o.Label -} - -func (o *OauthScope) GetDefaultApis() []string { - if o == nil { - return nil - } - return o.DefaultApis -} - -// UnifiedAPIOauthScope - OAuth scopes required for the connector. Add these scopes to your OAuth app. -type UnifiedAPIOauthScope struct { - // ID of the OAuth scope. - ID *string `json:"id,omitempty"` - // Label of the OAuth scope. - Label *string `json:"label,omitempty"` -} - -func (o *UnifiedAPIOauthScope) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *UnifiedAPIOauthScope) GetLabel() *string { - if o == nil { - return nil - } - return o.Label -} - -type ConnectorUnifiedAPI struct { - // Name of Apideck Unified API - ID *UnifiedAPIID `json:"id,omitempty"` - // Name of the API. - Name *string `json:"name,omitempty"` - // Indicates whether a connector only supports authentication. In this case the connector is not mapped to a Unified API, but can be used with the Proxy API - AuthOnly *bool `json:"auth_only,omitempty"` - OauthScopes []UnifiedAPIOauthScope `json:"oauth_scopes,omitempty"` - // List of resources that are supported on the connector. - SupportedResources []LinkedConnectorResource `json:"supported_resources,omitempty"` - // List of resources that are not supported on the downstream. - DownstreamUnsupportedResources []string `json:"downstream_unsupported_resources,omitempty"` - // List of events that are supported on the connector for this Unified API. - SupportedEvents []ConnectorEvent `json:"supported_events,omitempty"` -} - -func (o *ConnectorUnifiedAPI) GetID() *UnifiedAPIID { - if o == nil { - return nil - } - return o.ID -} - -func (o *ConnectorUnifiedAPI) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *ConnectorUnifiedAPI) GetAuthOnly() *bool { - if o == nil { - return nil - } - return o.AuthOnly -} - -func (o *ConnectorUnifiedAPI) GetOauthScopes() []UnifiedAPIOauthScope { - if o == nil { - return nil - } - return o.OauthScopes -} - -func (o *ConnectorUnifiedAPI) GetSupportedResources() []LinkedConnectorResource { - if o == nil { - return nil - } - return o.SupportedResources -} - -func (o *ConnectorUnifiedAPI) GetDownstreamUnsupportedResources() []string { - if o == nil { - return nil - } - return o.DownstreamUnsupportedResources -} - -func (o *ConnectorUnifiedAPI) GetSupportedEvents() []ConnectorEvent { - if o == nil { - return nil - } - return o.SupportedEvents -} - -type TLSSupport struct { - Type *string `json:"type,omitempty"` - // Description of the TLS support - Description *string `json:"description,omitempty"` -} - -func (o *TLSSupport) GetType() *string { - if o == nil { - return nil - } - return o.Type -} - -func (o *TLSSupport) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -type Connector struct { - // ID of the connector. - ID *string `json:"id,omitempty"` - // Name of the connector. - Name *string `json:"name,omitempty"` - // Status of the connector. Connectors with status live or beta are callable. - Status *ConnectorStatus `json:"status,omitempty"` - // A description of the object. - Description *string `json:"description,omitempty"` - // Link to a small square icon for the connector. - IconURL *string `json:"icon_url,omitempty"` - // Link to the full logo for the connector. - LogoURL *string `json:"logo_url,omitempty"` - // Link to the connector's website. - WebsiteURL *string `json:"website_url,omitempty"` - // Link to the connector's signup page. - SignupURL *string `json:"signup_url,omitempty"` - // Link to the connector's partner program signup page. - PartnerSignupURL *string `json:"partner_signup_url,omitempty"` - // Set to `true` when the connector offers a free trial. Use `signup_url` to sign up for a free trial - FreeTrialAvailable *bool `json:"free_trial_available,omitempty"` - // Type of authorization used by the connector - AuthType *ConnectorAuthType `json:"auth_type,omitempty"` - // Indicates whether a connector only supports authentication. In this case the connector is not mapped to a Unified API, but can be used with the Proxy API - AuthOnly *bool `json:"auth_only,omitempty"` - // Set to `true` when connector was implemented from downstream docs only and without API access. This state indicates that integration will require Apideck support, and access to downstream API to validate mapping quality. - BlindMapped *bool `json:"blind_mapped,omitempty"` - // OAuth grant type used by the connector. More info: https://oauth.net/2/grant-types - OauthGrantType *ConnectorOauthGrantType `json:"oauth_grant_type,omitempty"` - // Location of the OAuth client credentials. For most connectors the OAuth client credentials are stored on integration and managed by the application owner. For others they are stored on connection and managed by the consumer in Vault. - OauthCredentialsSource *OauthCredentialsSource `json:"oauth_credentials_source,omitempty"` - // List of OAuth Scopes available for this connector. - OauthScopes []OauthScope `json:"oauth_scopes,omitempty"` - // Set to `true` when connector allows the definition of custom scopes. - CustomScopes *bool `json:"custom_scopes,omitempty"` - // Indicates whether Apideck Sandbox OAuth credentials are available. - HasSandboxCredentials *bool `json:"has_sandbox_credentials,omitempty"` - Settings []ConnectorSetting `json:"settings,omitempty"` - // Service provider identifier - ServiceID *string `json:"service_id,omitempty"` - // List of Unified APIs that feature this connector. - UnifiedApis []ConnectorUnifiedAPI `json:"unified_apis,omitempty"` - // List of resources that are supported on the connector. - SupportedResources []LinkedConnectorResource `json:"supported_resources,omitempty"` - // List of resources that have settings that can be configured. - ConfigurableResources []string `json:"configurable_resources,omitempty"` - // List of events that are supported on the connector across all Unified APIs. - SupportedEvents []ConnectorEvent `json:"supported_events,omitempty"` - // How webhooks are supported for the connector. Sometimes the connector natively supports webhooks, other times Apideck virtualizes them based on polling. - WebhookSupport *WebhookSupport `json:"webhook_support,omitempty"` - // When a connector has schema_support, a call can be made to retrieve a json schema that describes a downstream resource. - SchemaSupport *SchemaSupport `json:"schema_support,omitempty"` - Docs []ConnectorDoc `json:"docs,omitempty"` - TLSSupport *TLSSupport `json:"tls_support,omitempty"` -} - -func (o *Connector) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Connector) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *Connector) GetStatus() *ConnectorStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *Connector) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *Connector) GetIconURL() *string { - if o == nil { - return nil - } - return o.IconURL -} - -func (o *Connector) GetLogoURL() *string { - if o == nil { - return nil - } - return o.LogoURL -} - -func (o *Connector) GetWebsiteURL() *string { - if o == nil { - return nil - } - return o.WebsiteURL -} - -func (o *Connector) GetSignupURL() *string { - if o == nil { - return nil - } - return o.SignupURL -} - -func (o *Connector) GetPartnerSignupURL() *string { - if o == nil { - return nil - } - return o.PartnerSignupURL -} - -func (o *Connector) GetFreeTrialAvailable() *bool { - if o == nil { - return nil - } - return o.FreeTrialAvailable -} - -func (o *Connector) GetAuthType() *ConnectorAuthType { - if o == nil { - return nil - } - return o.AuthType -} - -func (o *Connector) GetAuthOnly() *bool { - if o == nil { - return nil - } - return o.AuthOnly -} - -func (o *Connector) GetBlindMapped() *bool { - if o == nil { - return nil - } - return o.BlindMapped -} - -func (o *Connector) GetOauthGrantType() *ConnectorOauthGrantType { - if o == nil { - return nil - } - return o.OauthGrantType -} - -func (o *Connector) GetOauthCredentialsSource() *OauthCredentialsSource { - if o == nil { - return nil - } - return o.OauthCredentialsSource -} - -func (o *Connector) GetOauthScopes() []OauthScope { - if o == nil { - return nil - } - return o.OauthScopes -} - -func (o *Connector) GetCustomScopes() *bool { - if o == nil { - return nil - } - return o.CustomScopes -} - -func (o *Connector) GetHasSandboxCredentials() *bool { - if o == nil { - return nil - } - return o.HasSandboxCredentials -} - -func (o *Connector) GetSettings() []ConnectorSetting { - if o == nil { - return nil - } - return o.Settings -} - -func (o *Connector) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *Connector) GetUnifiedApis() []ConnectorUnifiedAPI { - if o == nil { - return nil - } - return o.UnifiedApis -} - -func (o *Connector) GetSupportedResources() []LinkedConnectorResource { - if o == nil { - return nil - } - return o.SupportedResources -} - -func (o *Connector) GetConfigurableResources() []string { - if o == nil { - return nil - } - return o.ConfigurableResources -} - -func (o *Connector) GetSupportedEvents() []ConnectorEvent { - if o == nil { - return nil - } - return o.SupportedEvents -} - -func (o *Connector) GetWebhookSupport() *WebhookSupport { - if o == nil { - return nil - } - return o.WebhookSupport -} - -func (o *Connector) GetSchemaSupport() *SchemaSupport { - if o == nil { - return nil - } - return o.SchemaSupport -} - -func (o *Connector) GetDocs() []ConnectorDoc { - if o == nil { - return nil - } - return o.Docs -} - -func (o *Connector) GetTLSSupport() *TLSSupport { - if o == nil { - return nil - } - return o.TLSSupport -} diff --git a/tests/mockserver/internal/sdk/models/components/connectordoc.go b/tests/mockserver/internal/sdk/models/components/connectordoc.go deleted file mode 100644 index 62c2aeb3..00000000 --- a/tests/mockserver/internal/sdk/models/components/connectordoc.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// Audience for the doc. -type Audience string - -const ( - AudienceApplicationOwner Audience = "application_owner" - AudienceConsumer Audience = "consumer" -) - -func (e Audience) ToPointer() *Audience { - return &e -} -func (e *Audience) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "application_owner": - fallthrough - case "consumer": - *e = Audience(v) - return nil - default: - return fmt.Errorf("invalid value for Audience: %v", v) - } -} - -// Format of the doc. -type Format string - -const ( - FormatMarkdown Format = "markdown" -) - -func (e Format) ToPointer() *Format { - return &e -} -func (e *Format) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "markdown": - *e = Format(v) - return nil - default: - return fmt.Errorf("invalid value for Format: %v", v) - } -} - -type ConnectorDoc struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // Name of the doc. - Name *string `json:"name,omitempty"` - // Audience for the doc. - Audience *Audience `json:"audience,omitempty"` - // Format of the doc. - Format *Format `json:"format,omitempty"` - // Link to fetch the content of the doc. - URL *string `json:"url,omitempty"` -} - -func (o *ConnectorDoc) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *ConnectorDoc) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *ConnectorDoc) GetAudience() *Audience { - if o == nil { - return nil - } - return o.Audience -} - -func (o *ConnectorDoc) GetFormat() *Format { - if o == nil { - return nil - } - return o.Format -} - -func (o *ConnectorDoc) GetURL() *string { - if o == nil { - return nil - } - return o.URL -} diff --git a/tests/mockserver/internal/sdk/models/components/connectorevent.go b/tests/mockserver/internal/sdk/models/components/connectorevent.go deleted file mode 100644 index 05c52417..00000000 --- a/tests/mockserver/internal/sdk/models/components/connectorevent.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// EventSource - Unify event source -type EventSource string - -const ( - EventSourceNative EventSource = "native" - EventSourceVirtual EventSource = "virtual" -) - -func (e EventSource) ToPointer() *EventSource { - return &e -} -func (e *EventSource) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "native": - fallthrough - case "virtual": - *e = EventSource(v) - return nil - default: - return fmt.Errorf("invalid value for EventSource: %v", v) - } -} - -// ConnectorEvent - Unify event that is supported on the connector. Events are delivered via Webhooks. -type ConnectorEvent struct { - // Unify event type - EventType *string `json:"event_type,omitempty"` - // Unify event source - EventSource *EventSource `json:"event_source,omitempty"` - // Downstream event type - DownstreamEventType *string `json:"downstream_event_type,omitempty"` - Resources []string `json:"resources,omitempty"` - // Unify entity type - EntityType *string `json:"entity_type,omitempty"` -} - -func (o *ConnectorEvent) GetEventType() *string { - if o == nil { - return nil - } - return o.EventType -} - -func (o *ConnectorEvent) GetEventSource() *EventSource { - if o == nil { - return nil - } - return o.EventSource -} - -func (o *ConnectorEvent) GetDownstreamEventType() *string { - if o == nil { - return nil - } - return o.DownstreamEventType -} - -func (o *ConnectorEvent) GetResources() []string { - if o == nil { - return nil - } - return o.Resources -} - -func (o *ConnectorEvent) GetEntityType() *string { - if o == nil { - return nil - } - return o.EntityType -} diff --git a/tests/mockserver/internal/sdk/models/components/connectorresource.go b/tests/mockserver/internal/sdk/models/components/connectorresource.go deleted file mode 100644 index 9897efdc..00000000 --- a/tests/mockserver/internal/sdk/models/components/connectorresource.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type ConnectorResource struct { - // ID of the resource, typically a lowercased version of name. - ID *string `json:"id,omitempty"` - // Name of the resource (plural) - Name *string `json:"name,omitempty"` - // ID of the resource in the Connector's API (downstream) - DownstreamID *string `json:"downstream_id,omitempty"` - // Name of the resource in the Connector's API (downstream) - DownstreamName *string `json:"downstream_name,omitempty"` - // Status of the resource. Resources with status live or beta are callable. - Status *ResourceStatus `json:"status,omitempty"` - // Indicates if pagination (cursor and limit parameters) is supported on the list endpoint of the resource. - PaginationSupported *bool `json:"pagination_supported,omitempty"` - Pagination *PaginationCoverage `json:"pagination,omitempty"` - // Indicates if custom fields are supported on this resource. - CustomFieldsSupported *bool `json:"custom_fields_supported,omitempty"` - // List of supported operations on the resource. - SupportedOperations []string `json:"supported_operations,omitempty"` - // List of operations that are not supported on the downstream. - DownstreamUnsupportedOperations []string `json:"downstream_unsupported_operations,omitempty"` - // Supported filters on the list endpoint of the resource. - SupportedFilters []string `json:"supported_filters,omitempty"` - // Supported sorting properties on the list endpoint of the resource. - SupportedSortBy []string `json:"supported_sort_by,omitempty"` - // Supported fields on the detail endpoint. - SupportedFields []SupportedProperty `json:"supported_fields,omitempty"` - // Supported fields on the list endpoint. - SupportedListFields []SupportedProperty `json:"supported_list_fields,omitempty"` -} - -func (o *ConnectorResource) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *ConnectorResource) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *ConnectorResource) GetDownstreamID() *string { - if o == nil { - return nil - } - return o.DownstreamID -} - -func (o *ConnectorResource) GetDownstreamName() *string { - if o == nil { - return nil - } - return o.DownstreamName -} - -func (o *ConnectorResource) GetStatus() *ResourceStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *ConnectorResource) GetPaginationSupported() *bool { - if o == nil { - return nil - } - return o.PaginationSupported -} - -func (o *ConnectorResource) GetPagination() *PaginationCoverage { - if o == nil { - return nil - } - return o.Pagination -} - -func (o *ConnectorResource) GetCustomFieldsSupported() *bool { - if o == nil { - return nil - } - return o.CustomFieldsSupported -} - -func (o *ConnectorResource) GetSupportedOperations() []string { - if o == nil { - return nil - } - return o.SupportedOperations -} - -func (o *ConnectorResource) GetDownstreamUnsupportedOperations() []string { - if o == nil { - return nil - } - return o.DownstreamUnsupportedOperations -} - -func (o *ConnectorResource) GetSupportedFilters() []string { - if o == nil { - return nil - } - return o.SupportedFilters -} - -func (o *ConnectorResource) GetSupportedSortBy() []string { - if o == nil { - return nil - } - return o.SupportedSortBy -} - -func (o *ConnectorResource) GetSupportedFields() []SupportedProperty { - if o == nil { - return nil - } - return o.SupportedFields -} - -func (o *ConnectorResource) GetSupportedListFields() []SupportedProperty { - if o == nil { - return nil - } - return o.SupportedListFields -} diff --git a/tests/mockserver/internal/sdk/models/components/connectorsetting.go b/tests/mockserver/internal/sdk/models/components/connectorsetting.go deleted file mode 100644 index c56f1481..00000000 --- a/tests/mockserver/internal/sdk/models/components/connectorsetting.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -type ConnectorSettingType string - -const ( - ConnectorSettingTypeText ConnectorSettingType = "text" - ConnectorSettingTypeCheckbox ConnectorSettingType = "checkbox" - ConnectorSettingTypeTel ConnectorSettingType = "tel" - ConnectorSettingTypeEmail ConnectorSettingType = "email" - ConnectorSettingTypeURL ConnectorSettingType = "url" - ConnectorSettingTypeTextarea ConnectorSettingType = "textarea" - ConnectorSettingTypeSelect ConnectorSettingType = "select" - ConnectorSettingTypeFilteredSelect ConnectorSettingType = "filtered-select" - ConnectorSettingTypeMultiSelect ConnectorSettingType = "multi-select" - ConnectorSettingTypeDatetime ConnectorSettingType = "datetime" - ConnectorSettingTypeDate ConnectorSettingType = "date" - ConnectorSettingTypeTime ConnectorSettingType = "time" - ConnectorSettingTypeNumber ConnectorSettingType = "number" - ConnectorSettingTypePassword ConnectorSettingType = "password" -) - -func (e ConnectorSettingType) ToPointer() *ConnectorSettingType { - return &e -} -func (e *ConnectorSettingType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "text": - fallthrough - case "checkbox": - fallthrough - case "tel": - fallthrough - case "email": - fallthrough - case "url": - fallthrough - case "textarea": - fallthrough - case "select": - fallthrough - case "filtered-select": - fallthrough - case "multi-select": - fallthrough - case "datetime": - fallthrough - case "date": - fallthrough - case "time": - fallthrough - case "number": - fallthrough - case "password": - *e = ConnectorSettingType(v) - return nil - default: - return fmt.Errorf("invalid value for ConnectorSettingType: %v", v) - } -} - -type ConnectorSetting struct { - ID *string `json:"id,omitempty"` - Label *string `json:"label,omitempty"` - Type *ConnectorSettingType `json:"type,omitempty"` -} - -func (o *ConnectorSetting) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *ConnectorSetting) GetLabel() *string { - if o == nil { - return nil - } - return o.Label -} - -func (o *ConnectorSetting) GetType() *ConnectorSettingType { - if o == nil { - return nil - } - return o.Type -} diff --git a/tests/mockserver/internal/sdk/models/components/connectorsfilter.go b/tests/mockserver/internal/sdk/models/components/connectorsfilter.go deleted file mode 100644 index 8d7e1f68..00000000 --- a/tests/mockserver/internal/sdk/models/components/connectorsfilter.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type ConnectorsFilter struct { - // Name of Apideck Unified API - UnifiedAPI *UnifiedAPIID `queryParam:"name=unified_api"` - // Status of the connector. Connectors with status live or beta are callable. - Status *ConnectorStatus `queryParam:"name=status"` -} - -func (o *ConnectorsFilter) GetUnifiedAPI() *UnifiedAPIID { - if o == nil { - return nil - } - return o.UnifiedAPI -} - -func (o *ConnectorsFilter) GetStatus() *ConnectorStatus { - if o == nil { - return nil - } - return o.Status -} diff --git a/tests/mockserver/internal/sdk/models/components/connectorstatus.go b/tests/mockserver/internal/sdk/models/components/connectorstatus.go deleted file mode 100644 index a33ce474..00000000 --- a/tests/mockserver/internal/sdk/models/components/connectorstatus.go +++ /dev/null @@ -1,41 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// ConnectorStatus - Status of the connector. Connectors with status live or beta are callable. -type ConnectorStatus string - -const ( - ConnectorStatusLive ConnectorStatus = "live" - ConnectorStatusBeta ConnectorStatus = "beta" - ConnectorStatusDevelopment ConnectorStatus = "development" - ConnectorStatusConsidering ConnectorStatus = "considering" -) - -func (e ConnectorStatus) ToPointer() *ConnectorStatus { - return &e -} -func (e *ConnectorStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "live": - fallthrough - case "beta": - fallthrough - case "development": - fallthrough - case "considering": - *e = ConnectorStatus(v) - return nil - default: - return fmt.Errorf("invalid value for ConnectorStatus: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/consumer.go b/tests/mockserver/internal/sdk/models/components/consumer.go deleted file mode 100644 index 3fe37d33..00000000 --- a/tests/mockserver/internal/sdk/models/components/consumer.go +++ /dev/null @@ -1,89 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type Consumer struct { - // Unique consumer identifier. You can freely choose a consumer ID yourself. Most of the time, this is an ID of your internal data model that represents a user or account in your system (for example account:12345). If the consumer doesn't exist yet, Vault will upsert a consumer based on your ID. - ConsumerID string `json:"consumer_id"` - // ID of your Apideck Application - ApplicationID *string `json:"application_id,omitempty"` - // The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. - Metadata *ConsumerMetadata `json:"metadata,omitempty"` - Connections []ConsumerConnection `json:"connections,omitempty"` - Services []string `json:"services,omitempty"` - AggregatedRequestCount *float64 `json:"aggregated_request_count,omitempty"` - RequestCounts *RequestCountAllocation `json:"request_counts,omitempty"` - Created *string `json:"created,omitempty"` - Modified *string `json:"modified,omitempty"` - RequestCountUpdated *string `json:"request_count_updated,omitempty"` -} - -func (o *Consumer) GetConsumerID() string { - if o == nil { - return "" - } - return o.ConsumerID -} - -func (o *Consumer) GetApplicationID() *string { - if o == nil { - return nil - } - return o.ApplicationID -} - -func (o *Consumer) GetMetadata() *ConsumerMetadata { - if o == nil { - return nil - } - return o.Metadata -} - -func (o *Consumer) GetConnections() []ConsumerConnection { - if o == nil { - return nil - } - return o.Connections -} - -func (o *Consumer) GetServices() []string { - if o == nil { - return nil - } - return o.Services -} - -func (o *Consumer) GetAggregatedRequestCount() *float64 { - if o == nil { - return nil - } - return o.AggregatedRequestCount -} - -func (o *Consumer) GetRequestCounts() *RequestCountAllocation { - if o == nil { - return nil - } - return o.RequestCounts -} - -func (o *Consumer) GetCreated() *string { - if o == nil { - return nil - } - return o.Created -} - -func (o *Consumer) GetModified() *string { - if o == nil { - return nil - } - return o.Modified -} - -func (o *Consumer) GetRequestCountUpdated() *string { - if o == nil { - return nil - } - return o.RequestCountUpdated -} diff --git a/tests/mockserver/internal/sdk/models/components/consumerconnection.go b/tests/mockserver/internal/sdk/models/components/consumerconnection.go deleted file mode 100644 index 8017ce96..00000000 --- a/tests/mockserver/internal/sdk/models/components/consumerconnection.go +++ /dev/null @@ -1,138 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type ConsumerConnection struct { - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Icon *string `json:"icon,omitempty"` - Logo *string `json:"logo,omitempty"` - Website *string `json:"website,omitempty"` - TagLine *string `json:"tag_line,omitempty"` - ServiceID *string `json:"service_id,omitempty"` - UnifiedAPI *string `json:"unified_api,omitempty"` - ConsumerID *string `json:"consumer_id,omitempty"` - // Type of authorization used by the connector - AuthType *AuthType `json:"auth_type,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - // Connection settings. Values will persist to `form_fields` with corresponding id - Settings map[string]any `json:"settings,omitempty"` - // Attach your own consumer specific metadata - Metadata map[string]any `json:"metadata,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` - // [Connection state flow](#section/Connection-state) - State *ConnectionState `json:"state,omitempty"` -} - -func (o *ConsumerConnection) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *ConsumerConnection) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *ConsumerConnection) GetIcon() *string { - if o == nil { - return nil - } - return o.Icon -} - -func (o *ConsumerConnection) GetLogo() *string { - if o == nil { - return nil - } - return o.Logo -} - -func (o *ConsumerConnection) GetWebsite() *string { - if o == nil { - return nil - } - return o.Website -} - -func (o *ConsumerConnection) GetTagLine() *string { - if o == nil { - return nil - } - return o.TagLine -} - -func (o *ConsumerConnection) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *ConsumerConnection) GetUnifiedAPI() *string { - if o == nil { - return nil - } - return o.UnifiedAPI -} - -func (o *ConsumerConnection) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *ConsumerConnection) GetAuthType() *AuthType { - if o == nil { - return nil - } - return o.AuthType -} - -func (o *ConsumerConnection) GetEnabled() *bool { - if o == nil { - return nil - } - return o.Enabled -} - -func (o *ConsumerConnection) GetSettings() map[string]any { - if o == nil { - return nil - } - return o.Settings -} - -func (o *ConsumerConnection) GetMetadata() map[string]any { - if o == nil { - return nil - } - return o.Metadata -} - -func (o *ConsumerConnection) GetCreatedAt() *string { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *ConsumerConnection) GetUpdatedAt() *string { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *ConsumerConnection) GetState() *ConnectionState { - if o == nil { - return nil - } - return o.State -} diff --git a/tests/mockserver/internal/sdk/models/components/consumerinput.go b/tests/mockserver/internal/sdk/models/components/consumerinput.go deleted file mode 100644 index 789b68fb..00000000 --- a/tests/mockserver/internal/sdk/models/components/consumerinput.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type ConsumerInput struct { - // Unique consumer identifier. You can freely choose a consumer ID yourself. Most of the time, this is an ID of your internal data model that represents a user or account in your system (for example account:12345). If the consumer doesn't exist yet, Vault will upsert a consumer based on your ID. - ConsumerID string `json:"consumer_id"` - // The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. - Metadata *ConsumerMetadata `json:"metadata,omitempty"` -} - -func (o *ConsumerInput) GetConsumerID() string { - if o == nil { - return "" - } - return o.ConsumerID -} - -func (o *ConsumerInput) GetMetadata() *ConsumerMetadata { - if o == nil { - return nil - } - return o.Metadata -} diff --git a/tests/mockserver/internal/sdk/models/components/consumermetadata.go b/tests/mockserver/internal/sdk/models/components/consumermetadata.go deleted file mode 100644 index b5350e3a..00000000 --- a/tests/mockserver/internal/sdk/models/components/consumermetadata.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// ConsumerMetadata - The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. -type ConsumerMetadata struct { - // The name of the account as shown in the sidebar. - AccountName *string `json:"account_name,omitempty"` - // The name of the user as shown in the sidebar. - UserName *string `json:"user_name,omitempty"` - // The email of the user as shown in the sidebar. - Email *string `json:"email,omitempty"` - // The avatar of the user in the sidebar. Must be a valid URL - Image *string `json:"image,omitempty"` -} - -func (o *ConsumerMetadata) GetAccountName() *string { - if o == nil { - return nil - } - return o.AccountName -} - -func (o *ConsumerMetadata) GetUserName() *string { - if o == nil { - return nil - } - return o.UserName -} - -func (o *ConsumerMetadata) GetEmail() *string { - if o == nil { - return nil - } - return o.Email -} - -func (o *ConsumerMetadata) GetImage() *string { - if o == nil { - return nil - } - return o.Image -} diff --git a/tests/mockserver/internal/sdk/models/components/consumerrequestcountsindaterangeresponse.go b/tests/mockserver/internal/sdk/models/components/consumerrequestcountsindaterangeresponse.go deleted file mode 100644 index 89b58eba..00000000 --- a/tests/mockserver/internal/sdk/models/components/consumerrequestcountsindaterangeresponse.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type ConsumerRequestCountsInDateRangeResponseData struct { - ApplicationID *string `json:"application_id,omitempty"` - ConsumerID *string `json:"consumer_id,omitempty"` - StartDatetime *string `json:"start_datetime,omitempty"` - EndDatetime *string `json:"end_datetime,omitempty"` - AggregatedRequestCount *float64 `json:"aggregated_request_count,omitempty"` - RequestCounts *RequestCountAllocation `json:"request_counts,omitempty"` -} - -func (o *ConsumerRequestCountsInDateRangeResponseData) GetApplicationID() *string { - if o == nil { - return nil - } - return o.ApplicationID -} - -func (o *ConsumerRequestCountsInDateRangeResponseData) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *ConsumerRequestCountsInDateRangeResponseData) GetStartDatetime() *string { - if o == nil { - return nil - } - return o.StartDatetime -} - -func (o *ConsumerRequestCountsInDateRangeResponseData) GetEndDatetime() *string { - if o == nil { - return nil - } - return o.EndDatetime -} - -func (o *ConsumerRequestCountsInDateRangeResponseData) GetAggregatedRequestCount() *float64 { - if o == nil { - return nil - } - return o.AggregatedRequestCount -} - -func (o *ConsumerRequestCountsInDateRangeResponseData) GetRequestCounts() *RequestCountAllocation { - if o == nil { - return nil - } - return o.RequestCounts -} - -// ConsumerRequestCountsInDateRangeResponse - Consumers Request Counts within Date Range -type ConsumerRequestCountsInDateRangeResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data ConsumerRequestCountsInDateRangeResponseData `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *ConsumerRequestCountsInDateRangeResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *ConsumerRequestCountsInDateRangeResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *ConsumerRequestCountsInDateRangeResponse) GetData() ConsumerRequestCountsInDateRangeResponseData { - if o == nil { - return ConsumerRequestCountsInDateRangeResponseData{} - } - return o.Data -} - -func (o *ConsumerRequestCountsInDateRangeResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/contact.go b/tests/mockserver/internal/sdk/models/components/contact.go deleted file mode 100644 index 964f41fe..00000000 --- a/tests/mockserver/internal/sdk/models/components/contact.go +++ /dev/null @@ -1,749 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// ContactType - The type of the contact. -type ContactType string - -const ( - ContactTypeCustomer ContactType = "customer" - ContactTypeSupplier ContactType = "supplier" - ContactTypeEmployee ContactType = "employee" - ContactTypePersonal ContactType = "personal" -) - -func (e ContactType) ToPointer() *ContactType { - return &e -} -func (e *ContactType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "customer": - fallthrough - case "supplier": - fallthrough - case "employee": - fallthrough - case "personal": - *e = ContactType(v) - return nil - default: - return fmt.Errorf("invalid value for ContactType: %v", v) - } -} - -// ContactGender - The gender of the contact. -type ContactGender string - -const ( - ContactGenderMale ContactGender = "male" - ContactGenderFemale ContactGender = "female" - ContactGenderUnisex ContactGender = "unisex" -) - -func (e ContactGender) ToPointer() *ContactGender { - return &e -} -func (e *ContactGender) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "male": - fallthrough - case "female": - fallthrough - case "unisex": - *e = ContactGender(v) - return nil - default: - return fmt.Errorf("invalid value for ContactGender: %v", v) - } -} - -type Contact struct { - // Unique identifier for the contact. - ID *string `json:"id,omitempty"` - // Full name of the contact. - Name *string `json:"name,omitempty"` - // The owner of the contact. - OwnerID *string `json:"owner_id,omitempty"` - // The type of the contact. - Type *ContactType `json:"type,omitempty"` - // The company the contact is associated with. - CompanyID *string `json:"company_id,omitempty"` - // The name of the company the contact is associated with. - CompanyName *string `json:"company_name,omitempty"` - // The lead the contact is associated with. - LeadID *string `json:"lead_id,omitempty"` - // The first name of the contact. - FirstName *string `json:"first_name,omitempty"` - // The middle name of the contact. - MiddleName *string `json:"middle_name,omitempty"` - // The last name of the contact. - LastName *string `json:"last_name,omitempty"` - // The prefix of the contact. - Prefix *string `json:"prefix,omitempty"` - // The suffix of the contact. - Suffix *string `json:"suffix,omitempty"` - // The job title of the contact. - Title *string `json:"title,omitempty"` - // The department of the contact. - Department *string `json:"department,omitempty"` - // language code according to ISO 639-1. For the United States - EN - Language *string `json:"language,omitempty"` - // The gender of the contact. - Gender *ContactGender `json:"gender,omitempty"` - // The birthday of the contact. - Birthday *string `json:"birthday,omitempty"` - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - Image *string `json:"image,omitempty"` - // The URL of the photo of a person. - PhotoURL *string `json:"photo_url,omitempty"` - // The lead source of the contact. - LeadSource *string `json:"lead_source,omitempty"` - // The fax number of the contact. - Fax *string `json:"fax,omitempty"` - // The description of the contact. - Description *string `json:"description,omitempty"` - // The current balance of the contact. - CurrentBalance *float64 `json:"current_balance,omitempty"` - // The status of the contact. - Status *string `json:"status,omitempty"` - // The active status of the contact. - Active *bool `json:"active,omitempty"` - Websites []Website `json:"websites,omitempty"` - Addresses []Address `json:"addresses,omitempty"` - SocialLinks []SocialLink `json:"social_links,omitempty"` - PhoneNumbers []PhoneNumber `json:"phone_numbers,omitempty"` - Emails []Email `json:"emails,omitempty"` - EmailDomain *string `json:"email_domain,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - Tags []string `json:"tags,omitempty"` - // The first call date of the contact. - FirstCallAt *time.Time `json:"first_call_at,omitempty"` - // The first email date of the contact. - FirstEmailAt *time.Time `json:"first_email_at,omitempty"` - // The last activity date of the contact. - LastActivityAt *time.Time `json:"last_activity_at,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // The last update date of the contact. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The creation date of the contact. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The opportunity ids of the contact. - OpportunityIds []string `json:"opportunity_ids,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (c Contact) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *Contact) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Contact) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Contact) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *Contact) GetOwnerID() *string { - if o == nil { - return nil - } - return o.OwnerID -} - -func (o *Contact) GetType() *ContactType { - if o == nil { - return nil - } - return o.Type -} - -func (o *Contact) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *Contact) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *Contact) GetLeadID() *string { - if o == nil { - return nil - } - return o.LeadID -} - -func (o *Contact) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *Contact) GetMiddleName() *string { - if o == nil { - return nil - } - return o.MiddleName -} - -func (o *Contact) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *Contact) GetPrefix() *string { - if o == nil { - return nil - } - return o.Prefix -} - -func (o *Contact) GetSuffix() *string { - if o == nil { - return nil - } - return o.Suffix -} - -func (o *Contact) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *Contact) GetDepartment() *string { - if o == nil { - return nil - } - return o.Department -} - -func (o *Contact) GetLanguage() *string { - if o == nil { - return nil - } - return o.Language -} - -func (o *Contact) GetGender() *ContactGender { - if o == nil { - return nil - } - return o.Gender -} - -func (o *Contact) GetBirthday() *string { - if o == nil { - return nil - } - return o.Birthday -} - -func (o *Contact) GetImage() *string { - if o == nil { - return nil - } - return o.Image -} - -func (o *Contact) GetPhotoURL() *string { - if o == nil { - return nil - } - return o.PhotoURL -} - -func (o *Contact) GetLeadSource() *string { - if o == nil { - return nil - } - return o.LeadSource -} - -func (o *Contact) GetFax() *string { - if o == nil { - return nil - } - return o.Fax -} - -func (o *Contact) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *Contact) GetCurrentBalance() *float64 { - if o == nil { - return nil - } - return o.CurrentBalance -} - -func (o *Contact) GetStatus() *string { - if o == nil { - return nil - } - return o.Status -} - -func (o *Contact) GetActive() *bool { - if o == nil { - return nil - } - return o.Active -} - -func (o *Contact) GetWebsites() []Website { - if o == nil { - return nil - } - return o.Websites -} - -func (o *Contact) GetAddresses() []Address { - if o == nil { - return nil - } - return o.Addresses -} - -func (o *Contact) GetSocialLinks() []SocialLink { - if o == nil { - return nil - } - return o.SocialLinks -} - -func (o *Contact) GetPhoneNumbers() []PhoneNumber { - if o == nil { - return nil - } - return o.PhoneNumbers -} - -func (o *Contact) GetEmails() []Email { - if o == nil { - return nil - } - return o.Emails -} - -func (o *Contact) GetEmailDomain() *string { - if o == nil { - return nil - } - return o.EmailDomain -} - -func (o *Contact) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *Contact) GetTags() []string { - if o == nil { - return nil - } - return o.Tags -} - -func (o *Contact) GetFirstCallAt() *time.Time { - if o == nil { - return nil - } - return o.FirstCallAt -} - -func (o *Contact) GetFirstEmailAt() *time.Time { - if o == nil { - return nil - } - return o.FirstEmailAt -} - -func (o *Contact) GetLastActivityAt() *time.Time { - if o == nil { - return nil - } - return o.LastActivityAt -} - -func (o *Contact) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Contact) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Contact) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Contact) GetOpportunityIds() []string { - if o == nil { - return nil - } - return o.OpportunityIds -} - -func (o *Contact) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type ContactInput struct { - // Full name of the contact. - Name *string `json:"name,omitempty"` - // The owner of the contact. - OwnerID *string `json:"owner_id,omitempty"` - // The type of the contact. - Type *ContactType `json:"type,omitempty"` - // The company the contact is associated with. - CompanyID *string `json:"company_id,omitempty"` - // The name of the company the contact is associated with. - CompanyName *string `json:"company_name,omitempty"` - // The lead the contact is associated with. - LeadID *string `json:"lead_id,omitempty"` - // The first name of the contact. - FirstName *string `json:"first_name,omitempty"` - // The middle name of the contact. - MiddleName *string `json:"middle_name,omitempty"` - // The last name of the contact. - LastName *string `json:"last_name,omitempty"` - // The prefix of the contact. - Prefix *string `json:"prefix,omitempty"` - // The suffix of the contact. - Suffix *string `json:"suffix,omitempty"` - // The job title of the contact. - Title *string `json:"title,omitempty"` - // The department of the contact. - Department *string `json:"department,omitempty"` - // language code according to ISO 639-1. For the United States - EN - Language *string `json:"language,omitempty"` - // The gender of the contact. - Gender *ContactGender `json:"gender,omitempty"` - // The birthday of the contact. - Birthday *string `json:"birthday,omitempty"` - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - Image *string `json:"image,omitempty"` - // The URL of the photo of a person. - PhotoURL *string `json:"photo_url,omitempty"` - // The lead source of the contact. - LeadSource *string `json:"lead_source,omitempty"` - // The fax number of the contact. - Fax *string `json:"fax,omitempty"` - // The description of the contact. - Description *string `json:"description,omitempty"` - // The current balance of the contact. - CurrentBalance *float64 `json:"current_balance,omitempty"` - // The status of the contact. - Status *string `json:"status,omitempty"` - // The active status of the contact. - Active *bool `json:"active,omitempty"` - Websites []Website `json:"websites,omitempty"` - Addresses []Address `json:"addresses,omitempty"` - SocialLinks []SocialLink `json:"social_links,omitempty"` - PhoneNumbers []PhoneNumber `json:"phone_numbers,omitempty"` - Emails []Email `json:"emails,omitempty"` - EmailDomain *string `json:"email_domain,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - Tags []string `json:"tags,omitempty"` - // The opportunity ids of the contact. - OpportunityIds []string `json:"opportunity_ids,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *ContactInput) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *ContactInput) GetOwnerID() *string { - if o == nil { - return nil - } - return o.OwnerID -} - -func (o *ContactInput) GetType() *ContactType { - if o == nil { - return nil - } - return o.Type -} - -func (o *ContactInput) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *ContactInput) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *ContactInput) GetLeadID() *string { - if o == nil { - return nil - } - return o.LeadID -} - -func (o *ContactInput) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *ContactInput) GetMiddleName() *string { - if o == nil { - return nil - } - return o.MiddleName -} - -func (o *ContactInput) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *ContactInput) GetPrefix() *string { - if o == nil { - return nil - } - return o.Prefix -} - -func (o *ContactInput) GetSuffix() *string { - if o == nil { - return nil - } - return o.Suffix -} - -func (o *ContactInput) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *ContactInput) GetDepartment() *string { - if o == nil { - return nil - } - return o.Department -} - -func (o *ContactInput) GetLanguage() *string { - if o == nil { - return nil - } - return o.Language -} - -func (o *ContactInput) GetGender() *ContactGender { - if o == nil { - return nil - } - return o.Gender -} - -func (o *ContactInput) GetBirthday() *string { - if o == nil { - return nil - } - return o.Birthday -} - -func (o *ContactInput) GetImage() *string { - if o == nil { - return nil - } - return o.Image -} - -func (o *ContactInput) GetPhotoURL() *string { - if o == nil { - return nil - } - return o.PhotoURL -} - -func (o *ContactInput) GetLeadSource() *string { - if o == nil { - return nil - } - return o.LeadSource -} - -func (o *ContactInput) GetFax() *string { - if o == nil { - return nil - } - return o.Fax -} - -func (o *ContactInput) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *ContactInput) GetCurrentBalance() *float64 { - if o == nil { - return nil - } - return o.CurrentBalance -} - -func (o *ContactInput) GetStatus() *string { - if o == nil { - return nil - } - return o.Status -} - -func (o *ContactInput) GetActive() *bool { - if o == nil { - return nil - } - return o.Active -} - -func (o *ContactInput) GetWebsites() []Website { - if o == nil { - return nil - } - return o.Websites -} - -func (o *ContactInput) GetAddresses() []Address { - if o == nil { - return nil - } - return o.Addresses -} - -func (o *ContactInput) GetSocialLinks() []SocialLink { - if o == nil { - return nil - } - return o.SocialLinks -} - -func (o *ContactInput) GetPhoneNumbers() []PhoneNumber { - if o == nil { - return nil - } - return o.PhoneNumbers -} - -func (o *ContactInput) GetEmails() []Email { - if o == nil { - return nil - } - return o.Emails -} - -func (o *ContactInput) GetEmailDomain() *string { - if o == nil { - return nil - } - return o.EmailDomain -} - -func (o *ContactInput) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *ContactInput) GetTags() []string { - if o == nil { - return nil - } - return o.Tags -} - -func (o *ContactInput) GetOpportunityIds() []string { - if o == nil { - return nil - } - return o.OpportunityIds -} - -func (o *ContactInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/contactsfilter.go b/tests/mockserver/internal/sdk/models/components/contactsfilter.go deleted file mode 100644 index e0b885d2..00000000 --- a/tests/mockserver/internal/sdk/models/components/contactsfilter.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type ContactsFilter struct { - // Name of the contact to filter on - Name *string `queryParam:"name=name"` - // First name of the contact to filter on - FirstName *string `queryParam:"name=first_name"` - // Last name of the contact to filter on - LastName *string `queryParam:"name=last_name"` - // Email of the contact to filter on - Email *string `queryParam:"name=email"` - // Phone number of the contact to filter on - PhoneNumber *string `queryParam:"name=phone_number"` - // Unique identifier for the associated company of the contact to filter on - CompanyID *string `queryParam:"name=company_id"` - // Unique identifier for the owner of the contact to filter on - OwnerID *string `queryParam:"name=owner_id"` -} - -func (o *ContactsFilter) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *ContactsFilter) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *ContactsFilter) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *ContactsFilter) GetEmail() *string { - if o == nil { - return nil - } - return o.Email -} - -func (o *ContactsFilter) GetPhoneNumber() *string { - if o == nil { - return nil - } - return o.PhoneNumber -} - -func (o *ContactsFilter) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *ContactsFilter) GetOwnerID() *string { - if o == nil { - return nil - } - return o.OwnerID -} diff --git a/tests/mockserver/internal/sdk/models/components/contactssort.go b/tests/mockserver/internal/sdk/models/components/contactssort.go deleted file mode 100644 index a2fed0c5..00000000 --- a/tests/mockserver/internal/sdk/models/components/contactssort.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// ContactsSortBy - The field on which to sort the Contacts -type ContactsSortBy string - -const ( - ContactsSortByCreatedAt ContactsSortBy = "created_at" - ContactsSortByUpdatedAt ContactsSortBy = "updated_at" - ContactsSortByName ContactsSortBy = "name" - ContactsSortByFirstName ContactsSortBy = "first_name" - ContactsSortByLastName ContactsSortBy = "last_name" - ContactsSortByEmail ContactsSortBy = "email" -) - -func (e ContactsSortBy) ToPointer() *ContactsSortBy { - return &e -} -func (e *ContactsSortBy) 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": - fallthrough - case "name": - fallthrough - case "first_name": - fallthrough - case "last_name": - fallthrough - case "email": - *e = ContactsSortBy(v) - return nil - default: - return fmt.Errorf("invalid value for ContactsSortBy: %v", v) - } -} - -type ContactsSort struct { - // The field on which to sort the Contacts - By *ContactsSortBy `queryParam:"name=by"` - // The direction in which to sort the results - Direction *SortDirection `default:"asc" queryParam:"name=direction"` -} - -func (c ContactsSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ContactsSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ContactsSort) GetBy() *ContactsSortBy { - if o == nil { - return nil - } - return o.By -} - -func (o *ContactsSort) GetDirection() *SortDirection { - if o == nil { - return nil - } - return o.Direction -} diff --git a/tests/mockserver/internal/sdk/models/components/copyfolderrequest.go b/tests/mockserver/internal/sdk/models/components/copyfolderrequest.go deleted file mode 100644 index 6b486d7d..00000000 --- a/tests/mockserver/internal/sdk/models/components/copyfolderrequest.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type CopyFolderRequest struct { - // The name of the folder. - Name *string `json:"name,omitempty"` - // The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. - ParentFolderID string `json:"parent_folder_id"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *CopyFolderRequest) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *CopyFolderRequest) GetParentFolderID() string { - if o == nil { - return "" - } - return o.ParentFolderID -} - -func (o *CopyFolderRequest) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/createaccountingdepartmentresponse.go b/tests/mockserver/internal/sdk/models/components/createaccountingdepartmentresponse.go deleted file mode 100644 index 53c0e91f..00000000 --- a/tests/mockserver/internal/sdk/models/components/createaccountingdepartmentresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateAccountingDepartmentResponse - Department -type CreateAccountingDepartmentResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateAccountingDepartmentResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateAccountingDepartmentResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateAccountingDepartmentResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateAccountingDepartmentResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateAccountingDepartmentResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateAccountingDepartmentResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateAccountingDepartmentResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createaccountinglocationresponse.go b/tests/mockserver/internal/sdk/models/components/createaccountinglocationresponse.go deleted file mode 100644 index a7fa34ee..00000000 --- a/tests/mockserver/internal/sdk/models/components/createaccountinglocationresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateAccountingLocationResponse - Location -type CreateAccountingLocationResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateAccountingLocationResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateAccountingLocationResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateAccountingLocationResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateAccountingLocationResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateAccountingLocationResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateAccountingLocationResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateAccountingLocationResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createactivityresponse.go b/tests/mockserver/internal/sdk/models/components/createactivityresponse.go deleted file mode 100644 index 8eac5303..00000000 --- a/tests/mockserver/internal/sdk/models/components/createactivityresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateActivityResponse - Activity created -type CreateActivityResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateActivityResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateActivityResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateActivityResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateActivityResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateActivityResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateActivityResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateActivityResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createapplicantresponse.go b/tests/mockserver/internal/sdk/models/components/createapplicantresponse.go deleted file mode 100644 index 2ded6c1f..00000000 --- a/tests/mockserver/internal/sdk/models/components/createapplicantresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateApplicantResponse - Applicants -type CreateApplicantResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateApplicantResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateApplicantResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateApplicantResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateApplicantResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateApplicantResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateApplicantResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateApplicantResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createapplicationresponse.go b/tests/mockserver/internal/sdk/models/components/createapplicationresponse.go deleted file mode 100644 index 1610e8d9..00000000 --- a/tests/mockserver/internal/sdk/models/components/createapplicationresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateApplicationResponse - Applications -type CreateApplicationResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateApplicationResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateApplicationResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateApplicationResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateApplicationResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateApplicationResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateApplicationResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateApplicationResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createattachmentresponse.go b/tests/mockserver/internal/sdk/models/components/createattachmentresponse.go deleted file mode 100644 index aa3cdbb9..00000000 --- a/tests/mockserver/internal/sdk/models/components/createattachmentresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateAttachmentResponse - Attachments -type CreateAttachmentResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateAttachmentResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateAttachmentResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateAttachmentResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateAttachmentResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateAttachmentResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateAttachmentResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateAttachmentResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createbankfeedaccountresponse.go b/tests/mockserver/internal/sdk/models/components/createbankfeedaccountresponse.go deleted file mode 100644 index 75b80c49..00000000 --- a/tests/mockserver/internal/sdk/models/components/createbankfeedaccountresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateBankFeedAccountResponse - Bank Feed Accounts -type CreateBankFeedAccountResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateBankFeedAccountResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateBankFeedAccountResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateBankFeedAccountResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateBankFeedAccountResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateBankFeedAccountResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateBankFeedAccountResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateBankFeedAccountResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createbankfeedstatementresponse.go b/tests/mockserver/internal/sdk/models/components/createbankfeedstatementresponse.go deleted file mode 100644 index d0a9ac9a..00000000 --- a/tests/mockserver/internal/sdk/models/components/createbankfeedstatementresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateBankFeedStatementResponse - Bank Feed Statements -type CreateBankFeedStatementResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateBankFeedStatementResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateBankFeedStatementResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateBankFeedStatementResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateBankFeedStatementResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateBankFeedStatementResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateBankFeedStatementResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateBankFeedStatementResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createbillpaymentresponse.go b/tests/mockserver/internal/sdk/models/components/createbillpaymentresponse.go deleted file mode 100644 index 34a6b7d8..00000000 --- a/tests/mockserver/internal/sdk/models/components/createbillpaymentresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateBillPaymentResponse - Bill Payment created -type CreateBillPaymentResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateBillPaymentResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateBillPaymentResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateBillPaymentResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateBillPaymentResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateBillPaymentResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateBillPaymentResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateBillPaymentResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createbillresponse.go b/tests/mockserver/internal/sdk/models/components/createbillresponse.go deleted file mode 100644 index 8671c640..00000000 --- a/tests/mockserver/internal/sdk/models/components/createbillresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateBillResponse - Bill created -type CreateBillResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateBillResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateBillResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateBillResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateBillResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateBillResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateBillResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateBillResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createcallbackstate.go b/tests/mockserver/internal/sdk/models/components/createcallbackstate.go deleted file mode 100644 index 55f43832..00000000 --- a/tests/mockserver/internal/sdk/models/components/createcallbackstate.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type CreateCallbackState struct { - // The redirect URI to be used after the connection is created. - RedirectURI *string `json:"redirect_uri,omitempty"` -} - -func (o *CreateCallbackState) GetRedirectURI() *string { - if o == nil { - return nil - } - return o.RedirectURI -} diff --git a/tests/mockserver/internal/sdk/models/components/createcallbackstateresponse.go b/tests/mockserver/internal/sdk/models/components/createcallbackstateresponse.go deleted file mode 100644 index 0531b14a..00000000 --- a/tests/mockserver/internal/sdk/models/components/createcallbackstateresponse.go +++ /dev/null @@ -1,54 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type CreateCallbackStateResponseData struct { - // Callback state - State *string `json:"state,omitempty"` -} - -func (o *CreateCallbackStateResponseData) GetState() *string { - if o == nil { - return nil - } - return o.State -} - -// CreateCallbackStateResponse - Callback state created -type CreateCallbackStateResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data CreateCallbackStateResponseData `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateCallbackStateResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateCallbackStateResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateCallbackStateResponse) GetData() CreateCallbackStateResponseData { - if o == nil { - return CreateCallbackStateResponseData{} - } - return o.Data -} - -func (o *CreateCallbackStateResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createcommentresponse.go b/tests/mockserver/internal/sdk/models/components/createcommentresponse.go deleted file mode 100644 index 7e935d1d..00000000 --- a/tests/mockserver/internal/sdk/models/components/createcommentresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateCommentResponse - Create a Comment -type CreateCommentResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateCommentResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateCommentResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateCommentResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateCommentResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateCommentResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateCommentResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateCommentResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createcompanyresponse.go b/tests/mockserver/internal/sdk/models/components/createcompanyresponse.go deleted file mode 100644 index c1894447..00000000 --- a/tests/mockserver/internal/sdk/models/components/createcompanyresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateCompanyResponse - Company created -type CreateCompanyResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateCompanyResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateCompanyResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateCompanyResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateCompanyResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateCompanyResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateCompanyResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateCompanyResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createconnectionresponse.go b/tests/mockserver/internal/sdk/models/components/createconnectionresponse.go deleted file mode 100644 index 8d0f5f91..00000000 --- a/tests/mockserver/internal/sdk/models/components/createconnectionresponse.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateConnectionResponse - Connection created -type CreateConnectionResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data Connection `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateConnectionResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateConnectionResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateConnectionResponse) GetData() Connection { - if o == nil { - return Connection{} - } - return o.Data -} - -func (o *CreateConnectionResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createconsumerresponse.go b/tests/mockserver/internal/sdk/models/components/createconsumerresponse.go deleted file mode 100644 index b95208c6..00000000 --- a/tests/mockserver/internal/sdk/models/components/createconsumerresponse.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateConsumerResponse - Consumer created -type CreateConsumerResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data Consumer `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateConsumerResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateConsumerResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateConsumerResponse) GetData() Consumer { - if o == nil { - return Consumer{} - } - return o.Data -} - -func (o *CreateConsumerResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createcontactresponse.go b/tests/mockserver/internal/sdk/models/components/createcontactresponse.go deleted file mode 100644 index 2e5714d4..00000000 --- a/tests/mockserver/internal/sdk/models/components/createcontactresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateContactResponse - Contact created -type CreateContactResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateContactResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateContactResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateContactResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateContactResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateContactResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateContactResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateContactResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createcreditnoteresponse.go b/tests/mockserver/internal/sdk/models/components/createcreditnoteresponse.go deleted file mode 100644 index 306dff1c..00000000 --- a/tests/mockserver/internal/sdk/models/components/createcreditnoteresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateCreditNoteResponse - Credit Note created -type CreateCreditNoteResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateCreditNoteResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateCreditNoteResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateCreditNoteResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateCreditNoteResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateCreditNoteResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateCreditNoteResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateCreditNoteResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createcustomerresponse.go b/tests/mockserver/internal/sdk/models/components/createcustomerresponse.go deleted file mode 100644 index b9a8f5d2..00000000 --- a/tests/mockserver/internal/sdk/models/components/createcustomerresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateCustomerResponse - Customers -type CreateCustomerResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateCustomerResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateCustomerResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateCustomerResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateCustomerResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateCustomerResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateCustomerResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateCustomerResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createcustomobjectresponse.go b/tests/mockserver/internal/sdk/models/components/createcustomobjectresponse.go deleted file mode 100644 index 0ed3c2ba..00000000 --- a/tests/mockserver/internal/sdk/models/components/createcustomobjectresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateCustomObjectResponse - Custom object created -type CreateCustomObjectResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateCustomObjectResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateCustomObjectResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateCustomObjectResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateCustomObjectResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateCustomObjectResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateCustomObjectResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateCustomObjectResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createcustomobjectschemaresponse.go b/tests/mockserver/internal/sdk/models/components/createcustomobjectschemaresponse.go deleted file mode 100644 index bbd00631..00000000 --- a/tests/mockserver/internal/sdk/models/components/createcustomobjectschemaresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateCustomObjectSchemaResponse - Custom object schema created -type CreateCustomObjectSchemaResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data CustomObjectSchema `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateCustomObjectSchemaResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateCustomObjectSchemaResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateCustomObjectSchemaResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateCustomObjectSchemaResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateCustomObjectSchemaResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateCustomObjectSchemaResponse) GetData() CustomObjectSchema { - if o == nil { - return CustomObjectSchema{} - } - return o.Data -} - -func (o *CreateCustomObjectSchemaResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createdepartmentresponse.go b/tests/mockserver/internal/sdk/models/components/createdepartmentresponse.go deleted file mode 100644 index 6a1f059b..00000000 --- a/tests/mockserver/internal/sdk/models/components/createdepartmentresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateDepartmentResponse - Departments -type CreateDepartmentResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateDepartmentResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateDepartmentResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateDepartmentResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateDepartmentResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateDepartmentResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateDepartmentResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateDepartmentResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createdrivegroupresponse.go b/tests/mockserver/internal/sdk/models/components/createdrivegroupresponse.go deleted file mode 100644 index e2f010eb..00000000 --- a/tests/mockserver/internal/sdk/models/components/createdrivegroupresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateDriveGroupResponse - DriveGroups -type CreateDriveGroupResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateDriveGroupResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateDriveGroupResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateDriveGroupResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateDriveGroupResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateDriveGroupResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateDriveGroupResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateDriveGroupResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createdriveresponse.go b/tests/mockserver/internal/sdk/models/components/createdriveresponse.go deleted file mode 100644 index 2f857106..00000000 --- a/tests/mockserver/internal/sdk/models/components/createdriveresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateDriveResponse - Drives -type CreateDriveResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateDriveResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateDriveResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateDriveResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateDriveResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateDriveResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateDriveResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateDriveResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createemployeeresponse.go b/tests/mockserver/internal/sdk/models/components/createemployeeresponse.go deleted file mode 100644 index 61ebd07d..00000000 --- a/tests/mockserver/internal/sdk/models/components/createemployeeresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateEmployeeResponse - Employees -type CreateEmployeeResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateEmployeeResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateEmployeeResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateEmployeeResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateEmployeeResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateEmployeeResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateEmployeeResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateEmployeeResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createexpenseresponse.go b/tests/mockserver/internal/sdk/models/components/createexpenseresponse.go deleted file mode 100644 index e4af60da..00000000 --- a/tests/mockserver/internal/sdk/models/components/createexpenseresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateExpenseResponse - Expenses -type CreateExpenseResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateExpenseResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateExpenseResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateExpenseResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateExpenseResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateExpenseResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateExpenseResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateExpenseResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createfolderrequest.go b/tests/mockserver/internal/sdk/models/components/createfolderrequest.go deleted file mode 100644 index 4b4c9308..00000000 --- a/tests/mockserver/internal/sdk/models/components/createfolderrequest.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type CreateFolderRequest struct { - // The name of the folder. - Name string `json:"name"` - // Optional description of the folder. - Description *string `json:"description,omitempty"` - // The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. - ParentFolderID string `json:"parent_folder_id"` - // ID of the drive to create the folder in. - DriveID *string `json:"drive_id,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *CreateFolderRequest) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *CreateFolderRequest) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *CreateFolderRequest) GetParentFolderID() string { - if o == nil { - return "" - } - return o.ParentFolderID -} - -func (o *CreateFolderRequest) GetDriveID() *string { - if o == nil { - return nil - } - return o.DriveID -} - -func (o *CreateFolderRequest) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/createfolderresponse.go b/tests/mockserver/internal/sdk/models/components/createfolderresponse.go deleted file mode 100644 index 8c242a97..00000000 --- a/tests/mockserver/internal/sdk/models/components/createfolderresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateFolderResponse - Folders -type CreateFolderResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateFolderResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateFolderResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateFolderResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateFolderResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateFolderResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateFolderResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateFolderResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createhriscompanyresponse.go b/tests/mockserver/internal/sdk/models/components/createhriscompanyresponse.go deleted file mode 100644 index bbdd4220..00000000 --- a/tests/mockserver/internal/sdk/models/components/createhriscompanyresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateHrisCompanyResponse - Companies -type CreateHrisCompanyResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateHrisCompanyResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateHrisCompanyResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateHrisCompanyResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateHrisCompanyResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateHrisCompanyResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateHrisCompanyResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateHrisCompanyResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createinvoiceitemresponse.go b/tests/mockserver/internal/sdk/models/components/createinvoiceitemresponse.go deleted file mode 100644 index 02563a0f..00000000 --- a/tests/mockserver/internal/sdk/models/components/createinvoiceitemresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateInvoiceItemResponse - InvoiceItems -type CreateInvoiceItemResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateInvoiceItemResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateInvoiceItemResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateInvoiceItemResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateInvoiceItemResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateInvoiceItemResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateInvoiceItemResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateInvoiceItemResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createinvoiceresponse.go b/tests/mockserver/internal/sdk/models/components/createinvoiceresponse.go deleted file mode 100644 index 49ef25b8..00000000 --- a/tests/mockserver/internal/sdk/models/components/createinvoiceresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateInvoiceResponse - Invoice created -type CreateInvoiceResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data InvoiceResponse `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateInvoiceResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateInvoiceResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateInvoiceResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateInvoiceResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateInvoiceResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateInvoiceResponse) GetData() InvoiceResponse { - if o == nil { - return InvoiceResponse{} - } - return o.Data -} - -func (o *CreateInvoiceResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createjournalentryresponse.go b/tests/mockserver/internal/sdk/models/components/createjournalentryresponse.go deleted file mode 100644 index 7763a333..00000000 --- a/tests/mockserver/internal/sdk/models/components/createjournalentryresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateJournalEntryResponse - JournalEntries -type CreateJournalEntryResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateJournalEntryResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateJournalEntryResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateJournalEntryResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateJournalEntryResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateJournalEntryResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateJournalEntryResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateJournalEntryResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createleadresponse.go b/tests/mockserver/internal/sdk/models/components/createleadresponse.go deleted file mode 100644 index 3fcbc19d..00000000 --- a/tests/mockserver/internal/sdk/models/components/createleadresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateLeadResponse - Lead created -type CreateLeadResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateLeadResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateLeadResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateLeadResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateLeadResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateLeadResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateLeadResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateLeadResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createledgeraccountresponse.go b/tests/mockserver/internal/sdk/models/components/createledgeraccountresponse.go deleted file mode 100644 index 1ba80b12..00000000 --- a/tests/mockserver/internal/sdk/models/components/createledgeraccountresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateLedgerAccountResponse - LedgerAccount created -type CreateLedgerAccountResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateLedgerAccountResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateLedgerAccountResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateLedgerAccountResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateLedgerAccountResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateLedgerAccountResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateLedgerAccountResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateLedgerAccountResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createmessageresponse.go b/tests/mockserver/internal/sdk/models/components/createmessageresponse.go deleted file mode 100644 index dc2ef4e2..00000000 --- a/tests/mockserver/internal/sdk/models/components/createmessageresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateMessageResponse - Messages -type CreateMessageResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateMessageResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateMessageResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateMessageResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateMessageResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateMessageResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateMessageResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateMessageResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createnoteresponse.go b/tests/mockserver/internal/sdk/models/components/createnoteresponse.go deleted file mode 100644 index 6fbb5472..00000000 --- a/tests/mockserver/internal/sdk/models/components/createnoteresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateNoteResponse - Note created -type CreateNoteResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateNoteResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateNoteResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateNoteResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateNoteResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateNoteResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateNoteResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateNoteResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createopportunityresponse.go b/tests/mockserver/internal/sdk/models/components/createopportunityresponse.go deleted file mode 100644 index 30a36dc8..00000000 --- a/tests/mockserver/internal/sdk/models/components/createopportunityresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateOpportunityResponse - Opportunity created -type CreateOpportunityResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateOpportunityResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateOpportunityResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateOpportunityResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateOpportunityResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateOpportunityResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateOpportunityResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateOpportunityResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createpaymentresponse.go b/tests/mockserver/internal/sdk/models/components/createpaymentresponse.go deleted file mode 100644 index 58257ab3..00000000 --- a/tests/mockserver/internal/sdk/models/components/createpaymentresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreatePaymentResponse - Payment created -type CreatePaymentResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreatePaymentResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreatePaymentResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreatePaymentResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreatePaymentResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreatePaymentResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreatePaymentResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreatePaymentResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createpipelineresponse.go b/tests/mockserver/internal/sdk/models/components/createpipelineresponse.go deleted file mode 100644 index cdd44a83..00000000 --- a/tests/mockserver/internal/sdk/models/components/createpipelineresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreatePipelineResponse - Pipeline created -type CreatePipelineResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreatePipelineResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreatePipelineResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreatePipelineResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreatePipelineResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreatePipelineResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreatePipelineResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreatePipelineResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createpurchaseorderresponse.go b/tests/mockserver/internal/sdk/models/components/createpurchaseorderresponse.go deleted file mode 100644 index ab33d382..00000000 --- a/tests/mockserver/internal/sdk/models/components/createpurchaseorderresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreatePurchaseOrderResponse - PurchaseOrders -type CreatePurchaseOrderResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreatePurchaseOrderResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreatePurchaseOrderResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreatePurchaseOrderResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreatePurchaseOrderResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreatePurchaseOrderResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreatePurchaseOrderResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreatePurchaseOrderResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createsessionresponse.go b/tests/mockserver/internal/sdk/models/components/createsessionresponse.go deleted file mode 100644 index 269fc9e0..00000000 --- a/tests/mockserver/internal/sdk/models/components/createsessionresponse.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type CreateSessionResponseData struct { - SessionURI string `json:"session_uri"` - SessionToken string `json:"session_token"` -} - -func (o *CreateSessionResponseData) GetSessionURI() string { - if o == nil { - return "" - } - return o.SessionURI -} - -func (o *CreateSessionResponseData) GetSessionToken() string { - if o == nil { - return "" - } - return o.SessionToken -} - -// CreateSessionResponse - Session created -type CreateSessionResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data CreateSessionResponseData `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateSessionResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateSessionResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateSessionResponse) GetData() CreateSessionResponseData { - if o == nil { - return CreateSessionResponseData{} - } - return o.Data -} - -func (o *CreateSessionResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createsharedlinkresponse.go b/tests/mockserver/internal/sdk/models/components/createsharedlinkresponse.go deleted file mode 100644 index 6f069ef9..00000000 --- a/tests/mockserver/internal/sdk/models/components/createsharedlinkresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateSharedLinkResponse - Shared Links -type CreateSharedLinkResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateSharedLinkResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateSharedLinkResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateSharedLinkResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateSharedLinkResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateSharedLinkResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateSharedLinkResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateSharedLinkResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createsubsidiaryresponse.go b/tests/mockserver/internal/sdk/models/components/createsubsidiaryresponse.go deleted file mode 100644 index e1624596..00000000 --- a/tests/mockserver/internal/sdk/models/components/createsubsidiaryresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateSubsidiaryResponse - Subsidiaries -type CreateSubsidiaryResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateSubsidiaryResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateSubsidiaryResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateSubsidiaryResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateSubsidiaryResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateSubsidiaryResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateSubsidiaryResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateSubsidiaryResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createsupplierresponse.go b/tests/mockserver/internal/sdk/models/components/createsupplierresponse.go deleted file mode 100644 index 6b14be3f..00000000 --- a/tests/mockserver/internal/sdk/models/components/createsupplierresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateSupplierResponse - Supplier created -type CreateSupplierResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateSupplierResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateSupplierResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateSupplierResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateSupplierResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateSupplierResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateSupplierResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateSupplierResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createtaxrateresponse.go b/tests/mockserver/internal/sdk/models/components/createtaxrateresponse.go deleted file mode 100644 index 66083701..00000000 --- a/tests/mockserver/internal/sdk/models/components/createtaxrateresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateTaxRateResponse - TaxRate created -type CreateTaxRateResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateTaxRateResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateTaxRateResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateTaxRateResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateTaxRateResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateTaxRateResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateTaxRateResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateTaxRateResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createticketresponse.go b/tests/mockserver/internal/sdk/models/components/createticketresponse.go deleted file mode 100644 index b52a32cc..00000000 --- a/tests/mockserver/internal/sdk/models/components/createticketresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateTicketResponse - Create a Ticket -type CreateTicketResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateTicketResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateTicketResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateTicketResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateTicketResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateTicketResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateTicketResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateTicketResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createtimeoffrequestresponse.go b/tests/mockserver/internal/sdk/models/components/createtimeoffrequestresponse.go deleted file mode 100644 index 0e364cfa..00000000 --- a/tests/mockserver/internal/sdk/models/components/createtimeoffrequestresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateTimeOffRequestResponse - TimeOffRequests -type CreateTimeOffRequestResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateTimeOffRequestResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateTimeOffRequestResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateTimeOffRequestResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateTimeOffRequestResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateTimeOffRequestResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateTimeOffRequestResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateTimeOffRequestResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createtrackingcategoryresponse.go b/tests/mockserver/internal/sdk/models/components/createtrackingcategoryresponse.go deleted file mode 100644 index ef6db807..00000000 --- a/tests/mockserver/internal/sdk/models/components/createtrackingcategoryresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateTrackingCategoryResponse - Tracking category created -type CreateTrackingCategoryResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateTrackingCategoryResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateTrackingCategoryResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateTrackingCategoryResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateTrackingCategoryResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateTrackingCategoryResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateTrackingCategoryResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateTrackingCategoryResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createuploadsessionrequest.go b/tests/mockserver/internal/sdk/models/components/createuploadsessionrequest.go deleted file mode 100644 index b2eeebad..00000000 --- a/tests/mockserver/internal/sdk/models/components/createuploadsessionrequest.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type CreateUploadSessionRequest struct { - // The name of the file. - Name string `json:"name"` - // The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. - ParentFolderID string `json:"parent_folder_id"` - // ID of the drive to upload to. - DriveID *string `json:"drive_id,omitempty"` - // The size of the file in bytes - Size *int64 `json:"size"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *CreateUploadSessionRequest) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *CreateUploadSessionRequest) GetParentFolderID() string { - if o == nil { - return "" - } - return o.ParentFolderID -} - -func (o *CreateUploadSessionRequest) GetDriveID() *string { - if o == nil { - return nil - } - return o.DriveID -} - -func (o *CreateUploadSessionRequest) GetSize() *int64 { - if o == nil { - return nil - } - return o.Size -} - -func (o *CreateUploadSessionRequest) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/createuploadsessionresponse.go b/tests/mockserver/internal/sdk/models/components/createuploadsessionresponse.go deleted file mode 100644 index 05937e0c..00000000 --- a/tests/mockserver/internal/sdk/models/components/createuploadsessionresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateUploadSessionResponse - UploadSessions -type CreateUploadSessionResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateUploadSessionResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateUploadSessionResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateUploadSessionResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateUploadSessionResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateUploadSessionResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateUploadSessionResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateUploadSessionResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createuserresponse.go b/tests/mockserver/internal/sdk/models/components/createuserresponse.go deleted file mode 100644 index d1086065..00000000 --- a/tests/mockserver/internal/sdk/models/components/createuserresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateUserResponse - User created -type CreateUserResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateUserResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateUserResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateUserResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *CreateUserResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *CreateUserResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *CreateUserResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *CreateUserResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/createwebhookrequest.go b/tests/mockserver/internal/sdk/models/components/createwebhookrequest.go deleted file mode 100644 index cf707905..00000000 --- a/tests/mockserver/internal/sdk/models/components/createwebhookrequest.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type CreateWebhookRequest struct { - // A description of the object. - Description *string `json:"description,omitempty"` - // Name of Apideck Unified API - UnifiedAPI UnifiedAPIID `json:"unified_api"` - // The status of the webhook. - Status Status `json:"status"` - // The delivery url of the webhook endpoint. - DeliveryURL string `json:"delivery_url"` - // The list of subscribed events for this webhook. [`*`] indicates that all events are enabled. - Events []WebhookEventType `json:"events"` -} - -func (o *CreateWebhookRequest) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *CreateWebhookRequest) GetUnifiedAPI() UnifiedAPIID { - if o == nil { - return UnifiedAPIID("") - } - return o.UnifiedAPI -} - -func (o *CreateWebhookRequest) GetStatus() Status { - if o == nil { - return Status("") - } - return o.Status -} - -func (o *CreateWebhookRequest) GetDeliveryURL() string { - if o == nil { - return "" - } - return o.DeliveryURL -} - -func (o *CreateWebhookRequest) GetEvents() []WebhookEventType { - if o == nil { - return []WebhookEventType{} - } - return o.Events -} diff --git a/tests/mockserver/internal/sdk/models/components/createwebhookresponse.go b/tests/mockserver/internal/sdk/models/components/createwebhookresponse.go deleted file mode 100644 index 1b1afd9c..00000000 --- a/tests/mockserver/internal/sdk/models/components/createwebhookresponse.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// CreateWebhookResponse - Webhooks -type CreateWebhookResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data Webhook `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *CreateWebhookResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *CreateWebhookResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *CreateWebhookResponse) GetData() Webhook { - if o == nil { - return Webhook{} - } - return o.Data -} - -func (o *CreateWebhookResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/creditnote.go b/tests/mockserver/internal/sdk/models/components/creditnote.go deleted file mode 100644 index 76402833..00000000 --- a/tests/mockserver/internal/sdk/models/components/creditnote.go +++ /dev/null @@ -1,647 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// CreditNoteStatus - Status of credit notes -type CreditNoteStatus string - -const ( - CreditNoteStatusDraft CreditNoteStatus = "draft" - CreditNoteStatusAuthorised CreditNoteStatus = "authorised" - CreditNoteStatusPaid CreditNoteStatus = "paid" - CreditNoteStatusVoided CreditNoteStatus = "voided" - CreditNoteStatusDeleted CreditNoteStatus = "deleted" -) - -func (e CreditNoteStatus) ToPointer() *CreditNoteStatus { - return &e -} -func (e *CreditNoteStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "draft": - fallthrough - case "authorised": - fallthrough - case "paid": - fallthrough - case "voided": - fallthrough - case "deleted": - *e = CreditNoteStatus(v) - return nil - default: - return fmt.Errorf("invalid value for CreditNoteStatus: %v", v) - } -} - -// CreditNoteType - Type of payment -type CreditNoteType string - -const ( - CreditNoteTypeAccountsReceivableCredit CreditNoteType = "accounts_receivable_credit" - CreditNoteTypeAccountsPayableCredit CreditNoteType = "accounts_payable_credit" -) - -func (e CreditNoteType) ToPointer() *CreditNoteType { - return &e -} -func (e *CreditNoteType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "accounts_receivable_credit": - fallthrough - case "accounts_payable_credit": - *e = CreditNoteType(v) - return nil - default: - return fmt.Errorf("invalid value for CreditNoteType: %v", v) - } -} - -type CreditNote struct { - // Unique identifier representing the entity - ID string `json:"id"` - // Credit note number. - Number *string `json:"number,omitempty"` - // The customer this entity is linked to. - Customer *LinkedCustomer `json:"customer,omitempty"` - // The company or subsidiary id the transaction belongs to - CompanyID *string `json:"company_id,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"` - // Currency Exchange Rate at the time entity was recorded/generated. - CurrencyRate *float64 `json:"currency_rate,omitempty"` - // Amounts are including tax - TaxInclusive *bool `json:"tax_inclusive,omitempty"` - // Sub-total amount, normally before tax. - SubTotal *float64 `json:"sub_total,omitempty"` - // Amount of transaction - TotalAmount float64 `json:"total_amount"` - // Total tax amount applied to this invoice. - TotalTax *float64 `json:"total_tax,omitempty"` - // Applicable tax id/code override if tax is not supplied on a line item basis. - TaxCode *string `json:"tax_code,omitempty"` - // The balance reflecting any payments made against the transaction. - Balance *float64 `json:"balance,omitempty"` - // Indicates the total credit amount still available to apply towards the payment. - RemainingCredit *float64 `json:"remaining_credit,omitempty"` - // Status of credit notes - Status *CreditNoteStatus `json:"status,omitempty"` - // Optional reference message ie: Debit remittance detail. - Reference *string `json:"reference,omitempty"` - // Date credit note issued - YYYY:MM::DDThh:mm:ss.sTZD - DateIssued *time.Time `json:"date_issued,omitempty"` - // Date credit note paid - YYYY:MM::DDThh:mm:ss.sTZD - DatePaid *time.Time `json:"date_paid,omitempty"` - // Type of payment - Type *CreditNoteType `json:"type,omitempty"` - Account *LinkedLedgerAccount `json:"account,omitempty"` - LineItems []InvoiceLineItem `json:"line_items,omitempty"` - Allocations []Allocation `json:"allocations,omitempty"` - // Optional note to be associated with the credit note. - Note *string `json:"note,omitempty"` - // Optional terms to be associated with the credit note. - Terms *string `json:"terms,omitempty"` - BillingAddress *Address `json:"billing_address,omitempty"` - ShippingAddress *Address `json:"shipping_address,omitempty"` - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (c CreditNote) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CreditNote) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CreditNote) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CreditNote) GetNumber() *string { - if o == nil { - return nil - } - return o.Number -} - -func (o *CreditNote) GetCustomer() *LinkedCustomer { - if o == nil { - return nil - } - return o.Customer -} - -func (o *CreditNote) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *CreditNote) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *CreditNote) GetCurrencyRate() *float64 { - if o == nil { - return nil - } - return o.CurrencyRate -} - -func (o *CreditNote) GetTaxInclusive() *bool { - if o == nil { - return nil - } - return o.TaxInclusive -} - -func (o *CreditNote) GetSubTotal() *float64 { - if o == nil { - return nil - } - return o.SubTotal -} - -func (o *CreditNote) GetTotalAmount() float64 { - if o == nil { - return 0.0 - } - return o.TotalAmount -} - -func (o *CreditNote) GetTotalTax() *float64 { - if o == nil { - return nil - } - return o.TotalTax -} - -func (o *CreditNote) GetTaxCode() *string { - if o == nil { - return nil - } - return o.TaxCode -} - -func (o *CreditNote) GetBalance() *float64 { - if o == nil { - return nil - } - return o.Balance -} - -func (o *CreditNote) GetRemainingCredit() *float64 { - if o == nil { - return nil - } - return o.RemainingCredit -} - -func (o *CreditNote) GetStatus() *CreditNoteStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *CreditNote) GetReference() *string { - if o == nil { - return nil - } - return o.Reference -} - -func (o *CreditNote) GetDateIssued() *time.Time { - if o == nil { - return nil - } - return o.DateIssued -} - -func (o *CreditNote) GetDatePaid() *time.Time { - if o == nil { - return nil - } - return o.DatePaid -} - -func (o *CreditNote) GetType() *CreditNoteType { - if o == nil { - return nil - } - return o.Type -} - -func (o *CreditNote) GetAccount() *LinkedLedgerAccount { - if o == nil { - return nil - } - return o.Account -} - -func (o *CreditNote) GetLineItems() []InvoiceLineItem { - if o == nil { - return nil - } - return o.LineItems -} - -func (o *CreditNote) GetAllocations() []Allocation { - if o == nil { - return nil - } - return o.Allocations -} - -func (o *CreditNote) GetNote() *string { - if o == nil { - return nil - } - return o.Note -} - -func (o *CreditNote) GetTerms() *string { - if o == nil { - return nil - } - return o.Terms -} - -func (o *CreditNote) GetBillingAddress() *Address { - if o == nil { - return nil - } - return o.BillingAddress -} - -func (o *CreditNote) GetShippingAddress() *Address { - if o == nil { - return nil - } - return o.ShippingAddress -} - -func (o *CreditNote) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *CreditNote) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *CreditNote) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *CreditNote) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *CreditNote) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *CreditNote) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *CreditNote) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *CreditNote) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *CreditNote) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type CreditNoteInput struct { - // Credit note number. - Number *string `json:"number,omitempty"` - // The customer this entity is linked to. - Customer *LinkedCustomerInput `json:"customer,omitempty"` - // The company or subsidiary id the transaction belongs to - CompanyID *string `json:"company_id,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"` - // Currency Exchange Rate at the time entity was recorded/generated. - CurrencyRate *float64 `json:"currency_rate,omitempty"` - // Amounts are including tax - TaxInclusive *bool `json:"tax_inclusive,omitempty"` - // Sub-total amount, normally before tax. - SubTotal *float64 `json:"sub_total,omitempty"` - // Amount of transaction - TotalAmount float64 `json:"total_amount"` - // Total tax amount applied to this invoice. - TotalTax *float64 `json:"total_tax,omitempty"` - // Applicable tax id/code override if tax is not supplied on a line item basis. - TaxCode *string `json:"tax_code,omitempty"` - // The balance reflecting any payments made against the transaction. - Balance *float64 `json:"balance,omitempty"` - // Indicates the total credit amount still available to apply towards the payment. - RemainingCredit *float64 `json:"remaining_credit,omitempty"` - // Status of credit notes - Status *CreditNoteStatus `json:"status,omitempty"` - // Optional reference message ie: Debit remittance detail. - Reference *string `json:"reference,omitempty"` - // Date credit note issued - YYYY:MM::DDThh:mm:ss.sTZD - DateIssued *time.Time `json:"date_issued,omitempty"` - // Date credit note paid - YYYY:MM::DDThh:mm:ss.sTZD - DatePaid *time.Time `json:"date_paid,omitempty"` - // Type of payment - Type *CreditNoteType `json:"type,omitempty"` - Account *LinkedLedgerAccountInput `json:"account,omitempty"` - LineItems []InvoiceLineItemInput `json:"line_items,omitempty"` - Allocations []AllocationInput `json:"allocations,omitempty"` - // Optional note to be associated with the credit note. - Note *string `json:"note,omitempty"` - // Optional terms to be associated with the credit note. - Terms *string `json:"terms,omitempty"` - BillingAddress *Address `json:"billing_address,omitempty"` - ShippingAddress *Address `json:"shipping_address,omitempty"` - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (c CreditNoteInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CreditNoteInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CreditNoteInput) GetNumber() *string { - if o == nil { - return nil - } - return o.Number -} - -func (o *CreditNoteInput) GetCustomer() *LinkedCustomerInput { - if o == nil { - return nil - } - return o.Customer -} - -func (o *CreditNoteInput) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *CreditNoteInput) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *CreditNoteInput) GetCurrencyRate() *float64 { - if o == nil { - return nil - } - return o.CurrencyRate -} - -func (o *CreditNoteInput) GetTaxInclusive() *bool { - if o == nil { - return nil - } - return o.TaxInclusive -} - -func (o *CreditNoteInput) GetSubTotal() *float64 { - if o == nil { - return nil - } - return o.SubTotal -} - -func (o *CreditNoteInput) GetTotalAmount() float64 { - if o == nil { - return 0.0 - } - return o.TotalAmount -} - -func (o *CreditNoteInput) GetTotalTax() *float64 { - if o == nil { - return nil - } - return o.TotalTax -} - -func (o *CreditNoteInput) GetTaxCode() *string { - if o == nil { - return nil - } - return o.TaxCode -} - -func (o *CreditNoteInput) GetBalance() *float64 { - if o == nil { - return nil - } - return o.Balance -} - -func (o *CreditNoteInput) GetRemainingCredit() *float64 { - if o == nil { - return nil - } - return o.RemainingCredit -} - -func (o *CreditNoteInput) GetStatus() *CreditNoteStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *CreditNoteInput) GetReference() *string { - if o == nil { - return nil - } - return o.Reference -} - -func (o *CreditNoteInput) GetDateIssued() *time.Time { - if o == nil { - return nil - } - return o.DateIssued -} - -func (o *CreditNoteInput) GetDatePaid() *time.Time { - if o == nil { - return nil - } - return o.DatePaid -} - -func (o *CreditNoteInput) GetType() *CreditNoteType { - if o == nil { - return nil - } - return o.Type -} - -func (o *CreditNoteInput) GetAccount() *LinkedLedgerAccountInput { - if o == nil { - return nil - } - return o.Account -} - -func (o *CreditNoteInput) GetLineItems() []InvoiceLineItemInput { - if o == nil { - return nil - } - return o.LineItems -} - -func (o *CreditNoteInput) GetAllocations() []AllocationInput { - if o == nil { - return nil - } - return o.Allocations -} - -func (o *CreditNoteInput) GetNote() *string { - if o == nil { - return nil - } - return o.Note -} - -func (o *CreditNoteInput) GetTerms() *string { - if o == nil { - return nil - } - return o.Terms -} - -func (o *CreditNoteInput) GetBillingAddress() *Address { - if o == nil { - return nil - } - return o.BillingAddress -} - -func (o *CreditNoteInput) GetShippingAddress() *Address { - if o == nil { - return nil - } - return o.ShippingAddress -} - -func (o *CreditNoteInput) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *CreditNoteInput) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *CreditNoteInput) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *CreditNoteInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/creditnotesfilter.go b/tests/mockserver/internal/sdk/models/components/creditnotesfilter.go deleted file mode 100644 index 5af208f7..00000000 --- a/tests/mockserver/internal/sdk/models/components/creditnotesfilter.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type CreditNotesFilter struct { - UpdatedSince *time.Time `queryParam:"name=updated_since"` -} - -func (c CreditNotesFilter) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CreditNotesFilter) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CreditNotesFilter) GetUpdatedSince() *time.Time { - if o == nil { - return nil - } - return o.UpdatedSince -} diff --git a/tests/mockserver/internal/sdk/models/components/creditnotessort.go b/tests/mockserver/internal/sdk/models/components/creditnotessort.go deleted file mode 100644 index 95479c1d..00000000 --- a/tests/mockserver/internal/sdk/models/components/creditnotessort.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// CreditNotesSortBy - The field on which to sort the Customers -type CreditNotesSortBy string - -const ( - CreditNotesSortByCreatedAt CreditNotesSortBy = "created_at" - CreditNotesSortByUpdatedAt CreditNotesSortBy = "updated_at" -) - -func (e CreditNotesSortBy) ToPointer() *CreditNotesSortBy { - return &e -} -func (e *CreditNotesSortBy) 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 = CreditNotesSortBy(v) - return nil - default: - return fmt.Errorf("invalid value for CreditNotesSortBy: %v", v) - } -} - -type CreditNotesSort struct { - // The field on which to sort the Customers - By *CreditNotesSortBy `queryParam:"name=by"` - // The direction in which to sort the results - Direction *SortDirection `default:"asc" queryParam:"name=direction"` -} - -func (c CreditNotesSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CreditNotesSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CreditNotesSort) GetBy() *CreditNotesSortBy { - if o == nil { - return nil - } - return o.By -} - -func (o *CreditNotesSort) GetDirection() *SortDirection { - if o == nil { - return nil - } - return o.Direction -} diff --git a/tests/mockserver/internal/sdk/models/components/creditordebit.go b/tests/mockserver/internal/sdk/models/components/creditordebit.go deleted file mode 100644 index f00919a7..00000000 --- a/tests/mockserver/internal/sdk/models/components/creditordebit.go +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// CreditOrDebit - Whether the amount is a credit or debit. -type CreditOrDebit string - -const ( - CreditOrDebitCredit CreditOrDebit = "credit" - CreditOrDebitDebit CreditOrDebit = "debit" -) - -func (e CreditOrDebit) ToPointer() *CreditOrDebit { - return &e -} -func (e *CreditOrDebit) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "credit": - fallthrough - case "debit": - *e = CreditOrDebit(v) - return nil - default: - return fmt.Errorf("invalid value for CreditOrDebit: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/currency.go b/tests/mockserver/internal/sdk/models/components/currency.go deleted file mode 100644 index 35ce5752..00000000 --- a/tests/mockserver/internal/sdk/models/components/currency.go +++ /dev/null @@ -1,578 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// Currency - Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). -type Currency string - -const ( - CurrencyUnknownCurrency Currency = "UNKNOWN_CURRENCY" - CurrencyAed Currency = "AED" - CurrencyAfn Currency = "AFN" - CurrencyAll Currency = "ALL" - CurrencyAmd Currency = "AMD" - CurrencyAng Currency = "ANG" - CurrencyAoa Currency = "AOA" - CurrencyArs Currency = "ARS" - CurrencyAud Currency = "AUD" - CurrencyAwg Currency = "AWG" - CurrencyAzn Currency = "AZN" - CurrencyBam Currency = "BAM" - CurrencyBbd Currency = "BBD" - CurrencyBdt Currency = "BDT" - CurrencyBgn Currency = "BGN" - CurrencyBhd Currency = "BHD" - CurrencyBif Currency = "BIF" - CurrencyBmd Currency = "BMD" - CurrencyBnd Currency = "BND" - CurrencyBob Currency = "BOB" - CurrencyBov Currency = "BOV" - CurrencyBrl Currency = "BRL" - CurrencyBsd Currency = "BSD" - CurrencyBtn Currency = "BTN" - CurrencyBwp Currency = "BWP" - CurrencyByr Currency = "BYR" - CurrencyBzd Currency = "BZD" - CurrencyCad Currency = "CAD" - CurrencyCdf Currency = "CDF" - CurrencyChe Currency = "CHE" - CurrencyChf Currency = "CHF" - CurrencyChw Currency = "CHW" - CurrencyClf Currency = "CLF" - CurrencyClp Currency = "CLP" - CurrencyCny Currency = "CNY" - CurrencyCop Currency = "COP" - CurrencyCou Currency = "COU" - CurrencyCrc Currency = "CRC" - CurrencyCuc Currency = "CUC" - CurrencyCup Currency = "CUP" - CurrencyCve Currency = "CVE" - CurrencyCzk Currency = "CZK" - CurrencyDjf Currency = "DJF" - CurrencyDkk Currency = "DKK" - CurrencyDop Currency = "DOP" - CurrencyDzd Currency = "DZD" - CurrencyEgp Currency = "EGP" - CurrencyErn Currency = "ERN" - CurrencyEtb Currency = "ETB" - CurrencyEur Currency = "EUR" - CurrencyFjd Currency = "FJD" - CurrencyFkp Currency = "FKP" - CurrencyGbp Currency = "GBP" - CurrencyGel Currency = "GEL" - CurrencyGhs Currency = "GHS" - CurrencyGip Currency = "GIP" - CurrencyGmd Currency = "GMD" - CurrencyGnf Currency = "GNF" - CurrencyGtq Currency = "GTQ" - CurrencyGyd Currency = "GYD" - CurrencyHkd Currency = "HKD" - CurrencyHnl Currency = "HNL" - CurrencyHrk Currency = "HRK" - CurrencyHtg Currency = "HTG" - CurrencyHuf Currency = "HUF" - CurrencyIdr Currency = "IDR" - CurrencyIls Currency = "ILS" - CurrencyInr Currency = "INR" - CurrencyIqd Currency = "IQD" - CurrencyIrr Currency = "IRR" - CurrencyIsk Currency = "ISK" - CurrencyJmd Currency = "JMD" - CurrencyJod Currency = "JOD" - CurrencyJpy Currency = "JPY" - CurrencyKes Currency = "KES" - CurrencyKgs Currency = "KGS" - CurrencyKhr Currency = "KHR" - CurrencyKmf Currency = "KMF" - CurrencyKpw Currency = "KPW" - CurrencyKrw Currency = "KRW" - CurrencyKwd Currency = "KWD" - CurrencyKyd Currency = "KYD" - CurrencyKzt Currency = "KZT" - CurrencyLak Currency = "LAK" - CurrencyLbp Currency = "LBP" - CurrencyLkr Currency = "LKR" - CurrencyLrd Currency = "LRD" - CurrencyLsl Currency = "LSL" - CurrencyLtl Currency = "LTL" - CurrencyLvl Currency = "LVL" - CurrencyLyd Currency = "LYD" - CurrencyMad Currency = "MAD" - CurrencyMdl Currency = "MDL" - CurrencyMga Currency = "MGA" - CurrencyMkd Currency = "MKD" - CurrencyMmk Currency = "MMK" - CurrencyMnt Currency = "MNT" - CurrencyMop Currency = "MOP" - CurrencyMro Currency = "MRO" - CurrencyMur Currency = "MUR" - CurrencyMvr Currency = "MVR" - CurrencyMwk Currency = "MWK" - CurrencyMxn Currency = "MXN" - CurrencyMxv Currency = "MXV" - CurrencyMyr Currency = "MYR" - CurrencyMzn Currency = "MZN" - CurrencyNad Currency = "NAD" - CurrencyNgn Currency = "NGN" - CurrencyNio Currency = "NIO" - CurrencyNok Currency = "NOK" - CurrencyNpr Currency = "NPR" - CurrencyNzd Currency = "NZD" - CurrencyOmr Currency = "OMR" - CurrencyPab Currency = "PAB" - CurrencyPen Currency = "PEN" - CurrencyPgk Currency = "PGK" - CurrencyPhp Currency = "PHP" - CurrencyPkr Currency = "PKR" - CurrencyPln Currency = "PLN" - CurrencyPyg Currency = "PYG" - CurrencyQar Currency = "QAR" - CurrencyRon Currency = "RON" - CurrencyRsd Currency = "RSD" - CurrencyRub Currency = "RUB" - CurrencyRwf Currency = "RWF" - CurrencySar Currency = "SAR" - CurrencySbd Currency = "SBD" - CurrencyScr Currency = "SCR" - CurrencySdg Currency = "SDG" - CurrencySek Currency = "SEK" - CurrencySgd Currency = "SGD" - CurrencyShp Currency = "SHP" - CurrencySll Currency = "SLL" - CurrencySos Currency = "SOS" - CurrencySrd Currency = "SRD" - CurrencySsp Currency = "SSP" - CurrencyStd Currency = "STD" - CurrencySvc Currency = "SVC" - CurrencySyp Currency = "SYP" - CurrencySzl Currency = "SZL" - CurrencyThb Currency = "THB" - CurrencyTjs Currency = "TJS" - CurrencyTmt Currency = "TMT" - CurrencyTnd Currency = "TND" - CurrencyTop Currency = "TOP" - CurrencyTrc Currency = "TRC" - CurrencyTry Currency = "TRY" - CurrencyTtd Currency = "TTD" - CurrencyTwd Currency = "TWD" - CurrencyTzs Currency = "TZS" - CurrencyUah Currency = "UAH" - CurrencyUgx Currency = "UGX" - CurrencyUsd Currency = "USD" - CurrencyUsn Currency = "USN" - CurrencyUss Currency = "USS" - CurrencyUyi Currency = "UYI" - CurrencyUyu Currency = "UYU" - CurrencyUzs Currency = "UZS" - CurrencyVef Currency = "VEF" - CurrencyVnd Currency = "VND" - CurrencyVuv Currency = "VUV" - CurrencyWst Currency = "WST" - CurrencyXaf Currency = "XAF" - CurrencyXag Currency = "XAG" - CurrencyXau Currency = "XAU" - CurrencyXba Currency = "XBA" - CurrencyXbb Currency = "XBB" - CurrencyXbc Currency = "XBC" - CurrencyXbd Currency = "XBD" - CurrencyXcd Currency = "XCD" - CurrencyXdr Currency = "XDR" - CurrencyXof Currency = "XOF" - CurrencyXpd Currency = "XPD" - CurrencyXpf Currency = "XPF" - CurrencyXpt Currency = "XPT" - CurrencyXts Currency = "XTS" - CurrencyXxx Currency = "XXX" - CurrencyYer Currency = "YER" - CurrencyZar Currency = "ZAR" - CurrencyZmk Currency = "ZMK" - CurrencyZmw Currency = "ZMW" - CurrencyBtc Currency = "BTC" - CurrencyEth Currency = "ETH" -) - -func (e Currency) ToPointer() *Currency { - return &e -} -func (e *Currency) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "UNKNOWN_CURRENCY": - fallthrough - case "AED": - fallthrough - case "AFN": - fallthrough - case "ALL": - fallthrough - case "AMD": - fallthrough - case "ANG": - fallthrough - case "AOA": - fallthrough - case "ARS": - fallthrough - case "AUD": - fallthrough - case "AWG": - fallthrough - case "AZN": - fallthrough - case "BAM": - fallthrough - case "BBD": - fallthrough - case "BDT": - fallthrough - case "BGN": - fallthrough - case "BHD": - fallthrough - case "BIF": - fallthrough - case "BMD": - fallthrough - case "BND": - fallthrough - case "BOB": - fallthrough - case "BOV": - fallthrough - case "BRL": - fallthrough - case "BSD": - fallthrough - case "BTN": - fallthrough - case "BWP": - fallthrough - case "BYR": - fallthrough - case "BZD": - fallthrough - case "CAD": - fallthrough - case "CDF": - fallthrough - case "CHE": - fallthrough - case "CHF": - fallthrough - case "CHW": - fallthrough - case "CLF": - fallthrough - case "CLP": - fallthrough - case "CNY": - fallthrough - case "COP": - fallthrough - case "COU": - fallthrough - case "CRC": - fallthrough - case "CUC": - fallthrough - case "CUP": - fallthrough - case "CVE": - fallthrough - case "CZK": - fallthrough - case "DJF": - fallthrough - case "DKK": - fallthrough - case "DOP": - fallthrough - case "DZD": - fallthrough - case "EGP": - fallthrough - case "ERN": - fallthrough - case "ETB": - fallthrough - case "EUR": - fallthrough - case "FJD": - fallthrough - case "FKP": - fallthrough - case "GBP": - fallthrough - case "GEL": - fallthrough - case "GHS": - fallthrough - case "GIP": - fallthrough - case "GMD": - fallthrough - case "GNF": - fallthrough - case "GTQ": - fallthrough - case "GYD": - fallthrough - case "HKD": - fallthrough - case "HNL": - fallthrough - case "HRK": - fallthrough - case "HTG": - fallthrough - case "HUF": - fallthrough - case "IDR": - fallthrough - case "ILS": - fallthrough - case "INR": - fallthrough - case "IQD": - fallthrough - case "IRR": - fallthrough - case "ISK": - fallthrough - case "JMD": - fallthrough - case "JOD": - fallthrough - case "JPY": - fallthrough - case "KES": - fallthrough - case "KGS": - fallthrough - case "KHR": - fallthrough - case "KMF": - fallthrough - case "KPW": - fallthrough - case "KRW": - fallthrough - case "KWD": - fallthrough - case "KYD": - fallthrough - case "KZT": - fallthrough - case "LAK": - fallthrough - case "LBP": - fallthrough - case "LKR": - fallthrough - case "LRD": - fallthrough - case "LSL": - fallthrough - case "LTL": - fallthrough - case "LVL": - fallthrough - case "LYD": - fallthrough - case "MAD": - fallthrough - case "MDL": - fallthrough - case "MGA": - fallthrough - case "MKD": - fallthrough - case "MMK": - fallthrough - case "MNT": - fallthrough - case "MOP": - fallthrough - case "MRO": - fallthrough - case "MUR": - fallthrough - case "MVR": - fallthrough - case "MWK": - fallthrough - case "MXN": - fallthrough - case "MXV": - fallthrough - case "MYR": - fallthrough - case "MZN": - fallthrough - case "NAD": - fallthrough - case "NGN": - fallthrough - case "NIO": - fallthrough - case "NOK": - fallthrough - case "NPR": - fallthrough - case "NZD": - fallthrough - case "OMR": - fallthrough - case "PAB": - fallthrough - case "PEN": - fallthrough - case "PGK": - fallthrough - case "PHP": - fallthrough - case "PKR": - fallthrough - case "PLN": - fallthrough - case "PYG": - fallthrough - case "QAR": - fallthrough - case "RON": - fallthrough - case "RSD": - fallthrough - case "RUB": - fallthrough - case "RWF": - fallthrough - case "SAR": - fallthrough - case "SBD": - fallthrough - case "SCR": - fallthrough - case "SDG": - fallthrough - case "SEK": - fallthrough - case "SGD": - fallthrough - case "SHP": - fallthrough - case "SLL": - fallthrough - case "SOS": - fallthrough - case "SRD": - fallthrough - case "SSP": - fallthrough - case "STD": - fallthrough - case "SVC": - fallthrough - case "SYP": - fallthrough - case "SZL": - fallthrough - case "THB": - fallthrough - case "TJS": - fallthrough - case "TMT": - fallthrough - case "TND": - fallthrough - case "TOP": - fallthrough - case "TRC": - fallthrough - case "TRY": - fallthrough - case "TTD": - fallthrough - case "TWD": - fallthrough - case "TZS": - fallthrough - case "UAH": - fallthrough - case "UGX": - fallthrough - case "USD": - fallthrough - case "USN": - fallthrough - case "USS": - fallthrough - case "UYI": - fallthrough - case "UYU": - fallthrough - case "UZS": - fallthrough - case "VEF": - fallthrough - case "VND": - fallthrough - case "VUV": - fallthrough - case "WST": - fallthrough - case "XAF": - fallthrough - case "XAG": - fallthrough - case "XAU": - fallthrough - case "XBA": - fallthrough - case "XBB": - fallthrough - case "XBC": - fallthrough - case "XBD": - fallthrough - case "XCD": - fallthrough - case "XDR": - fallthrough - case "XOF": - fallthrough - case "XPD": - fallthrough - case "XPF": - fallthrough - case "XPT": - fallthrough - case "XTS": - fallthrough - case "XXX": - fallthrough - case "YER": - fallthrough - case "ZAR": - fallthrough - case "ZMK": - fallthrough - case "ZMW": - fallthrough - case "BTC": - fallthrough - case "ETH": - *e = Currency(v) - return nil - default: - return fmt.Errorf("invalid value for Currency: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/customer.go b/tests/mockserver/internal/sdk/models/components/customer.go deleted file mode 100644 index 8872026b..00000000 --- a/tests/mockserver/internal/sdk/models/components/customer.go +++ /dev/null @@ -1,610 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// CustomerStatus - Customer status -type CustomerStatus string - -const ( - CustomerStatusActive CustomerStatus = "active" - CustomerStatusInactive CustomerStatus = "inactive" - CustomerStatusArchived CustomerStatus = "archived" - CustomerStatusGdprErasureRequest CustomerStatus = "gdpr-erasure-request" - CustomerStatusUnknown CustomerStatus = "unknown" -) - -func (e CustomerStatus) ToPointer() *CustomerStatus { - return &e -} -func (e *CustomerStatus) 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 "archived": - fallthrough - case "gdpr-erasure-request": - fallthrough - case "unknown": - *e = CustomerStatus(v) - return nil - default: - return fmt.Errorf("invalid value for CustomerStatus: %v", v) - } -} - -type Customer struct { - // A unique identifier for an object. - ID string `json:"id"` - // The third-party API ID of original entity - DownstreamID *string `json:"downstream_id,omitempty"` - // Display ID - DisplayID *string `json:"display_id,omitempty"` - // Display name - DisplayName *string `json:"display_name,omitempty"` - // The name of the company. - CompanyName *string `json:"company_name,omitempty"` - // The company or subsidiary id the transaction belongs to - CompanyID *string `json:"company_id,omitempty"` - // The job title of the person. - Title *string `json:"title,omitempty"` - // The first name of the person. - FirstName *string `json:"first_name,omitempty"` - // Middle name of the person. - MiddleName *string `json:"middle_name,omitempty"` - // The last name of the person. - LastName *string `json:"last_name,omitempty"` - Suffix *string `json:"suffix,omitempty"` - // Is this an individual or business customer - Individual *bool `json:"individual,omitempty"` - // If true, indicates this is a Project. - Project *bool `json:"project,omitempty"` - Addresses []Address `json:"addresses,omitempty"` - PhoneNumbers []PhoneNumber `json:"phone_numbers,omitempty"` - Emails []Email `json:"emails,omitempty"` - Websites []Website `json:"websites,omitempty"` - BankAccounts []BankAccount `json:"bank_accounts,omitempty"` - // Some notes about this customer - Notes *string `json:"notes,omitempty"` - TaxRate *LinkedTaxRate `json:"tax_rate,omitempty"` - TaxNumber *string `json:"tax_number,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"` - Account *LinkedLedgerAccount `json:"account,omitempty"` - // The parent customer this entity is linked to. - Parent *LinkedParentCustomer `json:"parent,omitempty"` - // Customer status - Status *CustomerStatus `json:"status,omitempty"` - // Payment method used for the transaction, such as cash, credit card, bank transfer, or check - PaymentMethod *string `json:"payment_method,omitempty"` - // The channel through which the transaction is processed. - Channel *string `json:"channel,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 user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (c Customer) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *Customer) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Customer) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *Customer) GetDownstreamID() *string { - if o == nil { - return nil - } - return o.DownstreamID -} - -func (o *Customer) GetDisplayID() *string { - if o == nil { - return nil - } - return o.DisplayID -} - -func (o *Customer) GetDisplayName() *string { - if o == nil { - return nil - } - return o.DisplayName -} - -func (o *Customer) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *Customer) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *Customer) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *Customer) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *Customer) GetMiddleName() *string { - if o == nil { - return nil - } - return o.MiddleName -} - -func (o *Customer) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *Customer) GetSuffix() *string { - if o == nil { - return nil - } - return o.Suffix -} - -func (o *Customer) GetIndividual() *bool { - if o == nil { - return nil - } - return o.Individual -} - -func (o *Customer) GetProject() *bool { - if o == nil { - return nil - } - return o.Project -} - -func (o *Customer) GetAddresses() []Address { - if o == nil { - return nil - } - return o.Addresses -} - -func (o *Customer) GetPhoneNumbers() []PhoneNumber { - if o == nil { - return nil - } - return o.PhoneNumbers -} - -func (o *Customer) GetEmails() []Email { - if o == nil { - return nil - } - return o.Emails -} - -func (o *Customer) GetWebsites() []Website { - if o == nil { - return nil - } - return o.Websites -} - -func (o *Customer) GetBankAccounts() []BankAccount { - if o == nil { - return nil - } - return o.BankAccounts -} - -func (o *Customer) GetNotes() *string { - if o == nil { - return nil - } - return o.Notes -} - -func (o *Customer) GetTaxRate() *LinkedTaxRate { - if o == nil { - return nil - } - return o.TaxRate -} - -func (o *Customer) GetTaxNumber() *string { - if o == nil { - return nil - } - return o.TaxNumber -} - -func (o *Customer) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *Customer) GetAccount() *LinkedLedgerAccount { - if o == nil { - return nil - } - return o.Account -} - -func (o *Customer) GetParent() *LinkedParentCustomer { - if o == nil { - return nil - } - return o.Parent -} - -func (o *Customer) GetStatus() *CustomerStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *Customer) GetPaymentMethod() *string { - if o == nil { - return nil - } - return o.PaymentMethod -} - -func (o *Customer) GetChannel() *string { - if o == nil { - return nil - } - return o.Channel -} - -func (o *Customer) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *Customer) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Customer) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *Customer) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *Customer) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Customer) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Customer) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *Customer) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type CustomerInput struct { - // Display ID - DisplayID *string `json:"display_id,omitempty"` - // Display name - DisplayName *string `json:"display_name,omitempty"` - // The name of the company. - CompanyName *string `json:"company_name,omitempty"` - // The company or subsidiary id the transaction belongs to - CompanyID *string `json:"company_id,omitempty"` - // The job title of the person. - Title *string `json:"title,omitempty"` - // The first name of the person. - FirstName *string `json:"first_name,omitempty"` - // Middle name of the person. - MiddleName *string `json:"middle_name,omitempty"` - // The last name of the person. - LastName *string `json:"last_name,omitempty"` - Suffix *string `json:"suffix,omitempty"` - // Is this an individual or business customer - Individual *bool `json:"individual,omitempty"` - // If true, indicates this is a Project. - Project *bool `json:"project,omitempty"` - Addresses []Address `json:"addresses,omitempty"` - PhoneNumbers []PhoneNumber `json:"phone_numbers,omitempty"` - Emails []Email `json:"emails,omitempty"` - Websites []Website `json:"websites,omitempty"` - BankAccounts []BankAccount `json:"bank_accounts,omitempty"` - // Some notes about this customer - Notes *string `json:"notes,omitempty"` - TaxRate *LinkedTaxRateInput `json:"tax_rate,omitempty"` - TaxNumber *string `json:"tax_number,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"` - Account *LinkedLedgerAccountInput `json:"account,omitempty"` - // The parent customer this entity is linked to. - Parent *LinkedParentCustomer `json:"parent,omitempty"` - // Customer status - Status *CustomerStatus `json:"status,omitempty"` - // Payment method used for the transaction, such as cash, credit card, bank transfer, or check - PaymentMethod *string `json:"payment_method,omitempty"` - // The channel through which the transaction is processed. - Channel *string `json:"channel,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *CustomerInput) GetDisplayID() *string { - if o == nil { - return nil - } - return o.DisplayID -} - -func (o *CustomerInput) GetDisplayName() *string { - if o == nil { - return nil - } - return o.DisplayName -} - -func (o *CustomerInput) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *CustomerInput) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *CustomerInput) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *CustomerInput) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *CustomerInput) GetMiddleName() *string { - if o == nil { - return nil - } - return o.MiddleName -} - -func (o *CustomerInput) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *CustomerInput) GetSuffix() *string { - if o == nil { - return nil - } - return o.Suffix -} - -func (o *CustomerInput) GetIndividual() *bool { - if o == nil { - return nil - } - return o.Individual -} - -func (o *CustomerInput) GetProject() *bool { - if o == nil { - return nil - } - return o.Project -} - -func (o *CustomerInput) GetAddresses() []Address { - if o == nil { - return nil - } - return o.Addresses -} - -func (o *CustomerInput) GetPhoneNumbers() []PhoneNumber { - if o == nil { - return nil - } - return o.PhoneNumbers -} - -func (o *CustomerInput) GetEmails() []Email { - if o == nil { - return nil - } - return o.Emails -} - -func (o *CustomerInput) GetWebsites() []Website { - if o == nil { - return nil - } - return o.Websites -} - -func (o *CustomerInput) GetBankAccounts() []BankAccount { - if o == nil { - return nil - } - return o.BankAccounts -} - -func (o *CustomerInput) GetNotes() *string { - if o == nil { - return nil - } - return o.Notes -} - -func (o *CustomerInput) GetTaxRate() *LinkedTaxRateInput { - if o == nil { - return nil - } - return o.TaxRate -} - -func (o *CustomerInput) GetTaxNumber() *string { - if o == nil { - return nil - } - return o.TaxNumber -} - -func (o *CustomerInput) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *CustomerInput) GetAccount() *LinkedLedgerAccountInput { - if o == nil { - return nil - } - return o.Account -} - -func (o *CustomerInput) GetParent() *LinkedParentCustomer { - if o == nil { - return nil - } - return o.Parent -} - -func (o *CustomerInput) GetStatus() *CustomerStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *CustomerInput) GetPaymentMethod() *string { - if o == nil { - return nil - } - return o.PaymentMethod -} - -func (o *CustomerInput) GetChannel() *string { - if o == nil { - return nil - } - return o.Channel -} - -func (o *CustomerInput) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *CustomerInput) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *CustomerInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/customersfilter.go b/tests/mockserver/internal/sdk/models/components/customersfilter.go deleted file mode 100644 index 3f3a0ea0..00000000 --- a/tests/mockserver/internal/sdk/models/components/customersfilter.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// CustomersFilterStatus - Status of customer to filter on -type CustomersFilterStatus string - -const ( - CustomersFilterStatusActive CustomersFilterStatus = "active" - CustomersFilterStatusInactive CustomersFilterStatus = "inactive" - CustomersFilterStatusArchived CustomersFilterStatus = "archived" - CustomersFilterStatusAll CustomersFilterStatus = "all" -) - -func (e CustomersFilterStatus) ToPointer() *CustomersFilterStatus { - return &e -} -func (e *CustomersFilterStatus) 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 "archived": - fallthrough - case "all": - *e = CustomersFilterStatus(v) - return nil - default: - return fmt.Errorf("invalid value for CustomersFilterStatus: %v", v) - } -} - -type CustomersFilter struct { - // Company Name of customer to search for - CompanyName *string `queryParam:"name=company_name"` - // Display Name of customer to search for - DisplayName *string `queryParam:"name=display_name"` - // First name of customer to search for - FirstName *string `queryParam:"name=first_name"` - // Last name of customer to search for - LastName *string `queryParam:"name=last_name"` - // Email of customer to search for - Email *string `queryParam:"name=email"` - // Status of customer to filter on - Status *CustomersFilterStatus `queryParam:"name=status"` - UpdatedSince *time.Time `queryParam:"name=updated_since"` - // Supplier ID of customer to search for - SupplierID *string `queryParam:"name=supplier_id"` -} - -func (c CustomersFilter) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CustomersFilter) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CustomersFilter) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *CustomersFilter) GetDisplayName() *string { - if o == nil { - return nil - } - return o.DisplayName -} - -func (o *CustomersFilter) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *CustomersFilter) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *CustomersFilter) GetEmail() *string { - if o == nil { - return nil - } - return o.Email -} - -func (o *CustomersFilter) GetStatus() *CustomersFilterStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *CustomersFilter) GetUpdatedSince() *time.Time { - if o == nil { - return nil - } - return o.UpdatedSince -} - -func (o *CustomersFilter) GetSupplierID() *string { - if o == nil { - return nil - } - return o.SupplierID -} diff --git a/tests/mockserver/internal/sdk/models/components/customerssort.go b/tests/mockserver/internal/sdk/models/components/customerssort.go deleted file mode 100644 index 56853e14..00000000 --- a/tests/mockserver/internal/sdk/models/components/customerssort.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// CustomersSortBy - The field on which to sort the Customers -type CustomersSortBy string - -const ( - CustomersSortByCreatedAt CustomersSortBy = "created_at" - CustomersSortByUpdatedAt CustomersSortBy = "updated_at" -) - -func (e CustomersSortBy) ToPointer() *CustomersSortBy { - return &e -} -func (e *CustomersSortBy) 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 = CustomersSortBy(v) - return nil - default: - return fmt.Errorf("invalid value for CustomersSortBy: %v", v) - } -} - -type CustomersSort struct { - // The field on which to sort the Customers - By *CustomersSortBy `queryParam:"name=by"` - // The direction in which to sort the results - Direction *SortDirection `default:"asc" queryParam:"name=direction"` -} - -func (c CustomersSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CustomersSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CustomersSort) GetBy() *CustomersSortBy { - if o == nil { - return nil - } - return o.By -} - -func (o *CustomersSort) GetDirection() *SortDirection { - if o == nil { - return nil - } - return o.Direction -} diff --git a/tests/mockserver/internal/sdk/models/components/customfield.go b/tests/mockserver/internal/sdk/models/components/customfield.go deleted file mode 100644 index f8fbba8f..00000000 --- a/tests/mockserver/internal/sdk/models/components/customfield.go +++ /dev/null @@ -1,204 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "errors" - "fmt" - "mockserver/internal/sdk/utils" -) - -type CustomFieldValue2 struct { -} - -type CustomFieldValue1 struct { -} - -type CustomFieldValueUnionType string - -const ( - CustomFieldValueUnionTypeStr CustomFieldValueUnionType = "str" - CustomFieldValueUnionTypeNumber CustomFieldValueUnionType = "number" - CustomFieldValueUnionTypeBoolean CustomFieldValueUnionType = "boolean" - CustomFieldValueUnionTypeCustomFieldValue1 CustomFieldValueUnionType = "CustomField_value_1" - CustomFieldValueUnionTypeArrayOfStr CustomFieldValueUnionType = "arrayOfStr" - CustomFieldValueUnionTypeArrayOfCustomFieldValue2 CustomFieldValueUnionType = "arrayOfCustomFieldValue2" -) - -type CustomFieldValueUnion struct { - Str *string `queryParam:"inline"` - Number *float64 `queryParam:"inline"` - Boolean *bool `queryParam:"inline"` - CustomFieldValue1 *CustomFieldValue1 `queryParam:"inline"` - ArrayOfStr []string `queryParam:"inline"` - ArrayOfCustomFieldValue2 []CustomFieldValue2 `queryParam:"inline"` - - Type CustomFieldValueUnionType -} - -func CreateCustomFieldValueUnionStr(str string) CustomFieldValueUnion { - typ := CustomFieldValueUnionTypeStr - - return CustomFieldValueUnion{ - Str: &str, - Type: typ, - } -} - -func CreateCustomFieldValueUnionNumber(number float64) CustomFieldValueUnion { - typ := CustomFieldValueUnionTypeNumber - - return CustomFieldValueUnion{ - Number: &number, - Type: typ, - } -} - -func CreateCustomFieldValueUnionBoolean(boolean bool) CustomFieldValueUnion { - typ := CustomFieldValueUnionTypeBoolean - - return CustomFieldValueUnion{ - Boolean: &boolean, - Type: typ, - } -} - -func CreateCustomFieldValueUnionCustomFieldValue1(customFieldValue1 CustomFieldValue1) CustomFieldValueUnion { - typ := CustomFieldValueUnionTypeCustomFieldValue1 - - return CustomFieldValueUnion{ - CustomFieldValue1: &customFieldValue1, - Type: typ, - } -} - -func CreateCustomFieldValueUnionArrayOfStr(arrayOfStr []string) CustomFieldValueUnion { - typ := CustomFieldValueUnionTypeArrayOfStr - - return CustomFieldValueUnion{ - ArrayOfStr: arrayOfStr, - Type: typ, - } -} - -func CreateCustomFieldValueUnionArrayOfCustomFieldValue2(arrayOfCustomFieldValue2 []CustomFieldValue2) CustomFieldValueUnion { - typ := CustomFieldValueUnionTypeArrayOfCustomFieldValue2 - - return CustomFieldValueUnion{ - ArrayOfCustomFieldValue2: arrayOfCustomFieldValue2, - Type: typ, - } -} - -func (u *CustomFieldValueUnion) UnmarshalJSON(data []byte) error { - - var customFieldValue1 CustomFieldValue1 = CustomFieldValue1{} - if err := utils.UnmarshalJSON(data, &customFieldValue1, "", true, true); err == nil { - u.CustomFieldValue1 = &customFieldValue1 - u.Type = CustomFieldValueUnionTypeCustomFieldValue1 - return nil - } - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = CustomFieldValueUnionTypeStr - return nil - } - - var number float64 = float64(0) - if err := utils.UnmarshalJSON(data, &number, "", true, true); err == nil { - u.Number = &number - u.Type = CustomFieldValueUnionTypeNumber - return nil - } - - var boolean bool = false - if err := utils.UnmarshalJSON(data, &boolean, "", true, true); err == nil { - u.Boolean = &boolean - u.Type = CustomFieldValueUnionTypeBoolean - return nil - } - - var arrayOfStr []string = []string{} - if err := utils.UnmarshalJSON(data, &arrayOfStr, "", true, true); err == nil { - u.ArrayOfStr = arrayOfStr - u.Type = CustomFieldValueUnionTypeArrayOfStr - return nil - } - - var arrayOfCustomFieldValue2 []CustomFieldValue2 = []CustomFieldValue2{} - if err := utils.UnmarshalJSON(data, &arrayOfCustomFieldValue2, "", true, true); err == nil { - u.ArrayOfCustomFieldValue2 = arrayOfCustomFieldValue2 - u.Type = CustomFieldValueUnionTypeArrayOfCustomFieldValue2 - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for CustomFieldValueUnion", string(data)) -} - -func (u CustomFieldValueUnion) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.Number != nil { - return utils.MarshalJSON(u.Number, "", true) - } - - if u.Boolean != nil { - return utils.MarshalJSON(u.Boolean, "", true) - } - - if u.CustomFieldValue1 != nil { - return utils.MarshalJSON(u.CustomFieldValue1, "", true) - } - - if u.ArrayOfStr != nil { - return utils.MarshalJSON(u.ArrayOfStr, "", true) - } - - if u.ArrayOfCustomFieldValue2 != nil { - return utils.MarshalJSON(u.ArrayOfCustomFieldValue2, "", true) - } - - return nil, errors.New("could not marshal union type CustomFieldValueUnion: all fields are null") -} - -type CustomField struct { - // Unique identifier for the custom field. - ID *string `json:"id"` - // Name of the custom field. - Name *string `json:"name,omitempty"` - // More information about the custom field - Description *string `json:"description,omitempty"` - Value *CustomFieldValueUnion `json:"value,omitempty"` -} - -func (o *CustomField) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *CustomField) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *CustomField) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *CustomField) GetValue() *CustomFieldValueUnion { - if o == nil { - return nil - } - return o.Value -} diff --git a/tests/mockserver/internal/sdk/models/components/customfieldfinder.go b/tests/mockserver/internal/sdk/models/components/customfieldfinder.go deleted file mode 100644 index 5cf373d4..00000000 --- a/tests/mockserver/internal/sdk/models/components/customfieldfinder.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type CustomFieldFinder struct { - // Custom Field ID - ID *string `json:"id,omitempty"` - // Custom Field name to use as a label if provided - Name *string `json:"name,omitempty"` - // More information about the custom field - Description *string `json:"description,omitempty"` - // Custom Field value - Value any `json:"value,omitempty"` - // JSONPath finder for retrieving this value when mapping a response payload from downstream - Finder *string `json:"finder,omitempty"` -} - -func (o *CustomFieldFinder) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *CustomFieldFinder) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *CustomFieldFinder) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *CustomFieldFinder) GetValue() any { - if o == nil { - return nil - } - return o.Value -} - -func (o *CustomFieldFinder) GetFinder() *string { - if o == nil { - return nil - } - return o.Finder -} diff --git a/tests/mockserver/internal/sdk/models/components/custommapping.go b/tests/mockserver/internal/sdk/models/components/custommapping.go deleted file mode 100644 index b761a097..00000000 --- a/tests/mockserver/internal/sdk/models/components/custommapping.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type CustomMapping struct { - // Target Field ID - ID *string `json:"id,omitempty"` - // Target Field name to use as a label - Label *string `json:"label,omitempty"` - // Target Field description - Description *string `json:"description,omitempty"` - // Target Field Mapping value - Value *string `json:"value,omitempty"` - // Target Field Key - Key *string `json:"key,omitempty"` - // Target Field Mapping is required - Required *bool `json:"required,omitempty"` - // This mapping represents a finder for a custom field - CustomField *bool `json:"custom_field,omitempty"` - // Consumer ID - ConsumerID *string `json:"consumer_id,omitempty"` - // Target Field Mapping example value from downstream - Example *string `json:"example,omitempty"` -} - -func (o *CustomMapping) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *CustomMapping) GetLabel() *string { - if o == nil { - return nil - } - return o.Label -} - -func (o *CustomMapping) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *CustomMapping) GetValue() *string { - if o == nil { - return nil - } - return o.Value -} - -func (o *CustomMapping) GetKey() *string { - if o == nil { - return nil - } - return o.Key -} - -func (o *CustomMapping) GetRequired() *bool { - if o == nil { - return nil - } - return o.Required -} - -func (o *CustomMapping) GetCustomField() *bool { - if o == nil { - return nil - } - return o.CustomField -} - -func (o *CustomMapping) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CustomMapping) GetExample() *string { - if o == nil { - return nil - } - return o.Example -} diff --git a/tests/mockserver/internal/sdk/models/components/custommappinginput.go b/tests/mockserver/internal/sdk/models/components/custommappinginput.go deleted file mode 100644 index d87033f2..00000000 --- a/tests/mockserver/internal/sdk/models/components/custommappinginput.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type CustomMappingInput struct { - // Target Field Mapping value - Value *string `json:"value,omitempty"` -} - -func (o *CustomMappingInput) GetValue() *string { - if o == nil { - return nil - } - return o.Value -} diff --git a/tests/mockserver/internal/sdk/models/components/customobject.go b/tests/mockserver/internal/sdk/models/components/customobject.go deleted file mode 100644 index 67d189b8..00000000 --- a/tests/mockserver/internal/sdk/models/components/customobject.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type CustomObjectField struct { - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` -} - -func (o *CustomObjectField) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *CustomObjectField) GetValue() *string { - if o == nil { - return nil - } - return o.Value -} - -type CustomObject struct { - // The unique identifier of the custom object - ID *string `json:"id,omitempty"` - // The unique identifier of the owner of the custom object - OwnerID *string `json:"owner_id,omitempty"` - // The name of the custom object - Name *string `json:"name,omitempty"` - Fields []CustomObjectField `json:"fields,omitempty"` - // The unique identifier of the user who last updated the custom object - UpdatedBy *string `json:"updated_by,omitempty"` - // The unique identifier of the user who created the custom object - CreatedBy *string `json:"created_by,omitempty"` - // The timestamp when the custom object was last updated - UpdatedAt *string `json:"updated_at,omitempty"` - // The timestamp when the custom object was created - CreatedAt *string `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *CustomObject) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *CustomObject) GetOwnerID() *string { - if o == nil { - return nil - } - return o.OwnerID -} - -func (o *CustomObject) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *CustomObject) GetFields() []CustomObjectField { - if o == nil { - return nil - } - return o.Fields -} - -func (o *CustomObject) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *CustomObject) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *CustomObject) GetUpdatedAt() *string { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *CustomObject) GetCreatedAt() *string { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *CustomObject) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type CustomObjectInput struct { - // The name of the custom object - Name *string `json:"name,omitempty"` - Fields []CustomObjectField `json:"fields,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *CustomObjectInput) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *CustomObjectInput) GetFields() []CustomObjectField { - if o == nil { - return nil - } - return o.Fields -} - -func (o *CustomObjectInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/customobjectschema.go b/tests/mockserver/internal/sdk/models/components/customobjectschema.go deleted file mode 100644 index 6f041a5e..00000000 --- a/tests/mockserver/internal/sdk/models/components/customobjectschema.go +++ /dev/null @@ -1,303 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -type CustomObjectSchemaType string - -const ( - CustomObjectSchemaTypeString CustomObjectSchemaType = "string" - CustomObjectSchemaTypeNumber CustomObjectSchemaType = "number" - CustomObjectSchemaTypeInteger CustomObjectSchemaType = "integer" - CustomObjectSchemaTypeBoolean CustomObjectSchemaType = "boolean" - CustomObjectSchemaTypeDate CustomObjectSchemaType = "date" - CustomObjectSchemaTypeDatetime CustomObjectSchemaType = "datetime" - CustomObjectSchemaTypeCurrency CustomObjectSchemaType = "currency" - CustomObjectSchemaTypeEmail CustomObjectSchemaType = "email" - CustomObjectSchemaTypePhone CustomObjectSchemaType = "phone" - CustomObjectSchemaTypeReference CustomObjectSchemaType = "reference" - CustomObjectSchemaTypeSelect CustomObjectSchemaType = "select" - CustomObjectSchemaTypeMultiselect CustomObjectSchemaType = "multiselect" -) - -func (e CustomObjectSchemaType) ToPointer() *CustomObjectSchemaType { - return &e -} -func (e *CustomObjectSchemaType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "string": - fallthrough - case "number": - fallthrough - case "integer": - fallthrough - case "boolean": - fallthrough - case "date": - fallthrough - case "datetime": - fallthrough - case "currency": - fallthrough - case "email": - fallthrough - case "phone": - fallthrough - case "reference": - fallthrough - case "select": - fallthrough - case "multiselect": - *e = CustomObjectSchemaType(v) - return nil - default: - return fmt.Errorf("invalid value for CustomObjectSchemaType: %v", v) - } -} - -type CustomObjectSchemaOption struct { - Value *string `json:"value,omitempty"` - Label *string `json:"label,omitempty"` -} - -func (o *CustomObjectSchemaOption) GetValue() *string { - if o == nil { - return nil - } - return o.Value -} - -func (o *CustomObjectSchemaOption) GetLabel() *string { - if o == nil { - return nil - } - return o.Label -} - -type CustomObjectSchemaField struct { - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - Type *CustomObjectSchemaType `json:"type,omitempty"` - Required *bool `json:"required,omitempty"` - // Options for select and multiselect types - Options []CustomObjectSchemaOption `json:"options,omitempty"` - // Default value for the field - DefaultValue *string `json:"default_value,omitempty"` -} - -func (o *CustomObjectSchemaField) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *CustomObjectSchemaField) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *CustomObjectSchemaField) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *CustomObjectSchemaField) GetType() *CustomObjectSchemaType { - if o == nil { - return nil - } - return o.Type -} - -func (o *CustomObjectSchemaField) GetRequired() *bool { - if o == nil { - return nil - } - return o.Required -} - -func (o *CustomObjectSchemaField) GetOptions() []CustomObjectSchemaOption { - if o == nil { - return nil - } - return o.Options -} - -func (o *CustomObjectSchemaField) GetDefaultValue() *string { - if o == nil { - return nil - } - return o.DefaultValue -} - -type CustomObjectSchema struct { - // The unique identifier of the custom object schema - ID *string `json:"id,omitempty"` - // The name of the custom object schema - Name *string `json:"name,omitempty"` - // The description of the custom object schema - Description *string `json:"description,omitempty"` - // The fields defined in the schema - Fields []CustomObjectSchemaField `json:"fields,omitempty"` - // Whether the custom object schema is visible in the UI - Visible *bool `json:"visible,omitempty"` - // Whether the custom object schema is active - Active *bool `json:"active,omitempty"` - // The ID of the user who created the custom object schema - CreatedBy *string `json:"created_by,omitempty"` - // The ID of the user who last updated the custom object schema - UpdatedBy *string `json:"updated_by,omitempty"` - // The timestamp when the custom object schema was last updated - UpdatedAt *string `json:"updated_at,omitempty"` - // The timestamp when the custom object schema was created - CreatedAt *string `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *CustomObjectSchema) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *CustomObjectSchema) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *CustomObjectSchema) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *CustomObjectSchema) GetFields() []CustomObjectSchemaField { - if o == nil { - return nil - } - return o.Fields -} - -func (o *CustomObjectSchema) GetVisible() *bool { - if o == nil { - return nil - } - return o.Visible -} - -func (o *CustomObjectSchema) GetActive() *bool { - if o == nil { - return nil - } - return o.Active -} - -func (o *CustomObjectSchema) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *CustomObjectSchema) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *CustomObjectSchema) GetUpdatedAt() *string { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *CustomObjectSchema) GetCreatedAt() *string { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *CustomObjectSchema) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type CustomObjectSchemaInput struct { - // The name of the custom object schema - Name *string `json:"name,omitempty"` - // The description of the custom object schema - Description *string `json:"description,omitempty"` - // The fields defined in the schema - Fields []CustomObjectSchemaField `json:"fields,omitempty"` - // Whether the custom object schema is visible in the UI - Visible *bool `json:"visible,omitempty"` - // Whether the custom object schema is active - Active *bool `json:"active,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *CustomObjectSchemaInput) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *CustomObjectSchemaInput) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *CustomObjectSchemaInput) GetFields() []CustomObjectSchemaField { - if o == nil { - return nil - } - return o.Fields -} - -func (o *CustomObjectSchemaInput) GetVisible() *bool { - if o == nil { - return nil - } - return o.Visible -} - -func (o *CustomObjectSchemaInput) GetActive() *bool { - if o == nil { - return nil - } - return o.Active -} - -func (o *CustomObjectSchemaInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/deduction.go b/tests/mockserver/internal/sdk/models/components/deduction.go deleted file mode 100644 index 452354de..00000000 --- a/tests/mockserver/internal/sdk/models/components/deduction.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type Deduction struct { - // The name of the deduction. - Name *string `json:"name,omitempty"` - // The amount deducted. - Amount *float64 `json:"amount,omitempty"` -} - -func (o *Deduction) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *Deduction) GetAmount() *float64 { - if o == nil { - return nil - } - return o.Amount -} diff --git a/tests/mockserver/internal/sdk/models/components/deleteaccountingdepartmentresponse.go b/tests/mockserver/internal/sdk/models/components/deleteaccountingdepartmentresponse.go deleted file mode 100644 index 5836f13b..00000000 --- a/tests/mockserver/internal/sdk/models/components/deleteaccountingdepartmentresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteAccountingDepartmentResponse - Department deleted -type DeleteAccountingDepartmentResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteAccountingDepartmentResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteAccountingDepartmentResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteAccountingDepartmentResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteAccountingDepartmentResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteAccountingDepartmentResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteAccountingDepartmentResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteAccountingDepartmentResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deleteaccountinglocationresponse.go b/tests/mockserver/internal/sdk/models/components/deleteaccountinglocationresponse.go deleted file mode 100644 index e7965246..00000000 --- a/tests/mockserver/internal/sdk/models/components/deleteaccountinglocationresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteAccountingLocationResponse - Location deleted -type DeleteAccountingLocationResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteAccountingLocationResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteAccountingLocationResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteAccountingLocationResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteAccountingLocationResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteAccountingLocationResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteAccountingLocationResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteAccountingLocationResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deleteactivityresponse.go b/tests/mockserver/internal/sdk/models/components/deleteactivityresponse.go deleted file mode 100644 index 09e73f46..00000000 --- a/tests/mockserver/internal/sdk/models/components/deleteactivityresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteActivityResponse - Activity deleted -type DeleteActivityResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteActivityResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteActivityResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteActivityResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteActivityResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteActivityResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteActivityResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteActivityResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deleteapplicantresponse.go b/tests/mockserver/internal/sdk/models/components/deleteapplicantresponse.go deleted file mode 100644 index ee34efb5..00000000 --- a/tests/mockserver/internal/sdk/models/components/deleteapplicantresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteApplicantResponse - Applicants -type DeleteApplicantResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteApplicantResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteApplicantResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteApplicantResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteApplicantResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteApplicantResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteApplicantResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteApplicantResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deleteapplicationresponse.go b/tests/mockserver/internal/sdk/models/components/deleteapplicationresponse.go deleted file mode 100644 index 779e546c..00000000 --- a/tests/mockserver/internal/sdk/models/components/deleteapplicationresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteApplicationResponse - Applications -type DeleteApplicationResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteApplicationResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteApplicationResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteApplicationResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteApplicationResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteApplicationResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteApplicationResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteApplicationResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deleteattachmentresponse.go b/tests/mockserver/internal/sdk/models/components/deleteattachmentresponse.go deleted file mode 100644 index bb0247d6..00000000 --- a/tests/mockserver/internal/sdk/models/components/deleteattachmentresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteAttachmentResponse - Attachments -type DeleteAttachmentResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteAttachmentResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteAttachmentResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteAttachmentResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteAttachmentResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteAttachmentResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteAttachmentResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteAttachmentResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletebankfeedaccountresponse.go b/tests/mockserver/internal/sdk/models/components/deletebankfeedaccountresponse.go deleted file mode 100644 index 2b4f9169..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletebankfeedaccountresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteBankFeedAccountResponse - Bank Feed Accounts -type DeleteBankFeedAccountResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteBankFeedAccountResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteBankFeedAccountResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteBankFeedAccountResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteBankFeedAccountResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteBankFeedAccountResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteBankFeedAccountResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteBankFeedAccountResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletebankfeedstatementresponse.go b/tests/mockserver/internal/sdk/models/components/deletebankfeedstatementresponse.go deleted file mode 100644 index c1944f9f..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletebankfeedstatementresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteBankFeedStatementResponse - Bank Feed Statements -type DeleteBankFeedStatementResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteBankFeedStatementResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteBankFeedStatementResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteBankFeedStatementResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteBankFeedStatementResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteBankFeedStatementResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteBankFeedStatementResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteBankFeedStatementResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletebillpaymentresponse.go b/tests/mockserver/internal/sdk/models/components/deletebillpaymentresponse.go deleted file mode 100644 index 813dc0f0..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletebillpaymentresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteBillPaymentResponse - Bill Payment deleted -type DeleteBillPaymentResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteBillPaymentResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteBillPaymentResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteBillPaymentResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteBillPaymentResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteBillPaymentResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteBillPaymentResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteBillPaymentResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletebillresponse.go b/tests/mockserver/internal/sdk/models/components/deletebillresponse.go deleted file mode 100644 index f0b9649d..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletebillresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteBillResponse - Bill deleted -type DeleteBillResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteBillResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteBillResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteBillResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteBillResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteBillResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteBillResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteBillResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletecommentresponse.go b/tests/mockserver/internal/sdk/models/components/deletecommentresponse.go deleted file mode 100644 index 044a43c7..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletecommentresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteCommentResponse - Delete a Comment -type DeleteCommentResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteCommentResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteCommentResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteCommentResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteCommentResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteCommentResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteCommentResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteCommentResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletecompanyresponse.go b/tests/mockserver/internal/sdk/models/components/deletecompanyresponse.go deleted file mode 100644 index 0132306d..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletecompanyresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteCompanyResponse - Company deleted -type DeleteCompanyResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteCompanyResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteCompanyResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteCompanyResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteCompanyResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteCompanyResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteCompanyResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteCompanyResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deleteconsumerresponse.go b/tests/mockserver/internal/sdk/models/components/deleteconsumerresponse.go deleted file mode 100644 index ed6f9a62..00000000 --- a/tests/mockserver/internal/sdk/models/components/deleteconsumerresponse.go +++ /dev/null @@ -1,54 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type DeleteConsumerResponseData struct { - // Unique consumer identifier. You can freely choose a consumer ID yourself. Most of the time, this is an ID of your internal data model that represents a user or account in your system (for example account:12345). If the consumer doesn't exist yet, Vault will upsert a consumer based on your ID. - ConsumerID *string `json:"consumer_id,omitempty"` -} - -func (o *DeleteConsumerResponseData) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -// DeleteConsumerResponse - Consumer deleted -type DeleteConsumerResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data DeleteConsumerResponseData `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteConsumerResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteConsumerResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteConsumerResponse) GetData() DeleteConsumerResponseData { - if o == nil { - return DeleteConsumerResponseData{} - } - return o.Data -} - -func (o *DeleteConsumerResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletecontactresponse.go b/tests/mockserver/internal/sdk/models/components/deletecontactresponse.go deleted file mode 100644 index 018aec2a..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletecontactresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteContactResponse - Contact deleted -type DeleteContactResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteContactResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteContactResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteContactResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteContactResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteContactResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteContactResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteContactResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletecreditnoteresponse.go b/tests/mockserver/internal/sdk/models/components/deletecreditnoteresponse.go deleted file mode 100644 index 2acd1529..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletecreditnoteresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteCreditNoteResponse - Credit Note deleted -type DeleteCreditNoteResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteCreditNoteResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteCreditNoteResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteCreditNoteResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteCreditNoteResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteCreditNoteResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteCreditNoteResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteCreditNoteResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletecustomerresponse.go b/tests/mockserver/internal/sdk/models/components/deletecustomerresponse.go deleted file mode 100644 index e6f089ab..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletecustomerresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteCustomerResponse - Customers -type DeleteCustomerResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteCustomerResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteCustomerResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteCustomerResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteCustomerResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteCustomerResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteCustomerResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteCustomerResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletecustomobjectresponse.go b/tests/mockserver/internal/sdk/models/components/deletecustomobjectresponse.go deleted file mode 100644 index fa47a01d..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletecustomobjectresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteCustomObjectResponse - Custom object deleted -type DeleteCustomObjectResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteCustomObjectResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteCustomObjectResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteCustomObjectResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteCustomObjectResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteCustomObjectResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteCustomObjectResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteCustomObjectResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletecustomobjectschemaresponse.go b/tests/mockserver/internal/sdk/models/components/deletecustomobjectschemaresponse.go deleted file mode 100644 index fe3fb06f..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletecustomobjectschemaresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteCustomObjectSchemaResponse - Custom object schema deleted -type DeleteCustomObjectSchemaResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteCustomObjectSchemaResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteCustomObjectSchemaResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteCustomObjectSchemaResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteCustomObjectSchemaResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteCustomObjectSchemaResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteCustomObjectSchemaResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteCustomObjectSchemaResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletedepartmentresponse.go b/tests/mockserver/internal/sdk/models/components/deletedepartmentresponse.go deleted file mode 100644 index 813739f6..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletedepartmentresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteDepartmentResponse - Departments -type DeleteDepartmentResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteDepartmentResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteDepartmentResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteDepartmentResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteDepartmentResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteDepartmentResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteDepartmentResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteDepartmentResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletedrivegroupresponse.go b/tests/mockserver/internal/sdk/models/components/deletedrivegroupresponse.go deleted file mode 100644 index ec06e20f..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletedrivegroupresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteDriveGroupResponse - DriveGroups -type DeleteDriveGroupResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteDriveGroupResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteDriveGroupResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteDriveGroupResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteDriveGroupResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteDriveGroupResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteDriveGroupResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteDriveGroupResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletedriveresponse.go b/tests/mockserver/internal/sdk/models/components/deletedriveresponse.go deleted file mode 100644 index c8e0f950..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletedriveresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteDriveResponse - Drives -type DeleteDriveResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteDriveResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteDriveResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteDriveResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteDriveResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteDriveResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteDriveResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteDriveResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deleteemployeeresponse.go b/tests/mockserver/internal/sdk/models/components/deleteemployeeresponse.go deleted file mode 100644 index 811e6a90..00000000 --- a/tests/mockserver/internal/sdk/models/components/deleteemployeeresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteEmployeeResponse - Employees -type DeleteEmployeeResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteEmployeeResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteEmployeeResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteEmployeeResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteEmployeeResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteEmployeeResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteEmployeeResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteEmployeeResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deleteexpenseresponse.go b/tests/mockserver/internal/sdk/models/components/deleteexpenseresponse.go deleted file mode 100644 index 1040a1a9..00000000 --- a/tests/mockserver/internal/sdk/models/components/deleteexpenseresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteExpenseResponse - Expenses -type DeleteExpenseResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteExpenseResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteExpenseResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteExpenseResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteExpenseResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteExpenseResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteExpenseResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteExpenseResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletefileresponse.go b/tests/mockserver/internal/sdk/models/components/deletefileresponse.go deleted file mode 100644 index 4a344f83..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletefileresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteFileResponse - Files -type DeleteFileResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteFileResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteFileResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteFileResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteFileResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteFileResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteFileResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteFileResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletefolderresponse.go b/tests/mockserver/internal/sdk/models/components/deletefolderresponse.go deleted file mode 100644 index e9b6317a..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletefolderresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteFolderResponse - Folders -type DeleteFolderResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteFolderResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteFolderResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteFolderResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteFolderResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteFolderResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteFolderResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteFolderResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletehriscompanyresponse.go b/tests/mockserver/internal/sdk/models/components/deletehriscompanyresponse.go deleted file mode 100644 index 1013568f..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletehriscompanyresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteHrisCompanyResponse - Companies -type DeleteHrisCompanyResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteHrisCompanyResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteHrisCompanyResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteHrisCompanyResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteHrisCompanyResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteHrisCompanyResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteHrisCompanyResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteHrisCompanyResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deleteinvoiceresponse.go b/tests/mockserver/internal/sdk/models/components/deleteinvoiceresponse.go deleted file mode 100644 index caea4c86..00000000 --- a/tests/mockserver/internal/sdk/models/components/deleteinvoiceresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteInvoiceResponse - Invoice deleted -type DeleteInvoiceResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data InvoiceResponse `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteInvoiceResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteInvoiceResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteInvoiceResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteInvoiceResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteInvoiceResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteInvoiceResponse) GetData() InvoiceResponse { - if o == nil { - return InvoiceResponse{} - } - return o.Data -} - -func (o *DeleteInvoiceResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletejournalentryresponse.go b/tests/mockserver/internal/sdk/models/components/deletejournalentryresponse.go deleted file mode 100644 index 9319a1f8..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletejournalentryresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteJournalEntryResponse - JournalEntries -type DeleteJournalEntryResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteJournalEntryResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteJournalEntryResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteJournalEntryResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteJournalEntryResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteJournalEntryResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteJournalEntryResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteJournalEntryResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deleteleadresponse.go b/tests/mockserver/internal/sdk/models/components/deleteleadresponse.go deleted file mode 100644 index 6dd0a12b..00000000 --- a/tests/mockserver/internal/sdk/models/components/deleteleadresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteLeadResponse - Lead deleted -type DeleteLeadResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteLeadResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteLeadResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteLeadResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteLeadResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteLeadResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteLeadResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteLeadResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deleteledgeraccountresponse.go b/tests/mockserver/internal/sdk/models/components/deleteledgeraccountresponse.go deleted file mode 100644 index 9e083824..00000000 --- a/tests/mockserver/internal/sdk/models/components/deleteledgeraccountresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteLedgerAccountResponse - LedgerAccount deleted -type DeleteLedgerAccountResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteLedgerAccountResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteLedgerAccountResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteLedgerAccountResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteLedgerAccountResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteLedgerAccountResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteLedgerAccountResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteLedgerAccountResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletemessageresponse.go b/tests/mockserver/internal/sdk/models/components/deletemessageresponse.go deleted file mode 100644 index 2f7d32b2..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletemessageresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteMessageResponse - Messages -type DeleteMessageResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteMessageResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteMessageResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteMessageResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteMessageResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteMessageResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteMessageResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteMessageResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletenoteresponse.go b/tests/mockserver/internal/sdk/models/components/deletenoteresponse.go deleted file mode 100644 index b9247ee8..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletenoteresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteNoteResponse - Note deleted -type DeleteNoteResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteNoteResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteNoteResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteNoteResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteNoteResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteNoteResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteNoteResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteNoteResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deleteopportunityresponse.go b/tests/mockserver/internal/sdk/models/components/deleteopportunityresponse.go deleted file mode 100644 index 1fd91312..00000000 --- a/tests/mockserver/internal/sdk/models/components/deleteopportunityresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteOpportunityResponse - Opportunity deleted -type DeleteOpportunityResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteOpportunityResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteOpportunityResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteOpportunityResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteOpportunityResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteOpportunityResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteOpportunityResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteOpportunityResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletepaymentresponse.go b/tests/mockserver/internal/sdk/models/components/deletepaymentresponse.go deleted file mode 100644 index 0e1b7620..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletepaymentresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeletePaymentResponse - Payment deleted -type DeletePaymentResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeletePaymentResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeletePaymentResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeletePaymentResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeletePaymentResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeletePaymentResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeletePaymentResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeletePaymentResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletepipelineresponse.go b/tests/mockserver/internal/sdk/models/components/deletepipelineresponse.go deleted file mode 100644 index 465cd220..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletepipelineresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeletePipelineResponse - Pipeline deleted -type DeletePipelineResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeletePipelineResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeletePipelineResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeletePipelineResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeletePipelineResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeletePipelineResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeletePipelineResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeletePipelineResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletepurchaseorderresponse.go b/tests/mockserver/internal/sdk/models/components/deletepurchaseorderresponse.go deleted file mode 100644 index 4e7eb181..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletepurchaseorderresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeletePurchaseOrderResponse - PurchaseOrders -type DeletePurchaseOrderResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeletePurchaseOrderResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeletePurchaseOrderResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeletePurchaseOrderResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeletePurchaseOrderResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeletePurchaseOrderResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeletePurchaseOrderResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeletePurchaseOrderResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletesharedlinkresponse.go b/tests/mockserver/internal/sdk/models/components/deletesharedlinkresponse.go deleted file mode 100644 index 0412296d..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletesharedlinkresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteSharedLinkResponse - Shared Links -type DeleteSharedLinkResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteSharedLinkResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteSharedLinkResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteSharedLinkResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteSharedLinkResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteSharedLinkResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteSharedLinkResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteSharedLinkResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletesubsidiaryresponse.go b/tests/mockserver/internal/sdk/models/components/deletesubsidiaryresponse.go deleted file mode 100644 index 22a166f3..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletesubsidiaryresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteSubsidiaryResponse - Subsidiarys -type DeleteSubsidiaryResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteSubsidiaryResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteSubsidiaryResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteSubsidiaryResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteSubsidiaryResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteSubsidiaryResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteSubsidiaryResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteSubsidiaryResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletesupplierresponse.go b/tests/mockserver/internal/sdk/models/components/deletesupplierresponse.go deleted file mode 100644 index 3f132c07..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletesupplierresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteSupplierResponse - Supplier deleted -type DeleteSupplierResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteSupplierResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteSupplierResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteSupplierResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteSupplierResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteSupplierResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteSupplierResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteSupplierResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletetaxrateresponse.go b/tests/mockserver/internal/sdk/models/components/deletetaxrateresponse.go deleted file mode 100644 index 10d712b6..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletetaxrateresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteTaxRateResponse - TaxRates deleted -type DeleteTaxRateResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteTaxRateResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteTaxRateResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteTaxRateResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteTaxRateResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteTaxRateResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteTaxRateResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteTaxRateResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deleteticketresponse.go b/tests/mockserver/internal/sdk/models/components/deleteticketresponse.go deleted file mode 100644 index 9202bfc7..00000000 --- a/tests/mockserver/internal/sdk/models/components/deleteticketresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteTicketResponse - Delete a Ticket -type DeleteTicketResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteTicketResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteTicketResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteTicketResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteTicketResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteTicketResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteTicketResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteTicketResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletetimeoffrequestresponse.go b/tests/mockserver/internal/sdk/models/components/deletetimeoffrequestresponse.go deleted file mode 100644 index a346d469..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletetimeoffrequestresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteTimeOffRequestResponse - TimeOffRequests -type DeleteTimeOffRequestResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteTimeOffRequestResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteTimeOffRequestResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteTimeOffRequestResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteTimeOffRequestResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteTimeOffRequestResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteTimeOffRequestResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteTimeOffRequestResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletetrackingcategoryresponse.go b/tests/mockserver/internal/sdk/models/components/deletetrackingcategoryresponse.go deleted file mode 100644 index 0dbe8f3b..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletetrackingcategoryresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteTrackingCategoryResponse - Tracking category deleted -type DeleteTrackingCategoryResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteTrackingCategoryResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteTrackingCategoryResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteTrackingCategoryResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteTrackingCategoryResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteTrackingCategoryResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteTrackingCategoryResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteTrackingCategoryResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deleteuploadsessionresponse.go b/tests/mockserver/internal/sdk/models/components/deleteuploadsessionresponse.go deleted file mode 100644 index ceb409f5..00000000 --- a/tests/mockserver/internal/sdk/models/components/deleteuploadsessionresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteUploadSessionResponse - UploadSessions -type DeleteUploadSessionResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteUploadSessionResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteUploadSessionResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteUploadSessionResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteUploadSessionResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteUploadSessionResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteUploadSessionResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteUploadSessionResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deleteuserresponse.go b/tests/mockserver/internal/sdk/models/components/deleteuserresponse.go deleted file mode 100644 index 08fb44c8..00000000 --- a/tests/mockserver/internal/sdk/models/components/deleteuserresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteUserResponse - User deleted -type DeleteUserResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteUserResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteUserResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteUserResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *DeleteUserResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *DeleteUserResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *DeleteUserResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *DeleteUserResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/deletewebhookresponse.go b/tests/mockserver/internal/sdk/models/components/deletewebhookresponse.go deleted file mode 100644 index 1fe87502..00000000 --- a/tests/mockserver/internal/sdk/models/components/deletewebhookresponse.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeleteWebhookResponse - Webhooks -type DeleteWebhookResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data Webhook `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *DeleteWebhookResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *DeleteWebhookResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *DeleteWebhookResponse) GetData() Webhook { - if o == nil { - return Webhook{} - } - return o.Data -} - -func (o *DeleteWebhookResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/department.go b/tests/mockserver/internal/sdk/models/components/department.go deleted file mode 100644 index 74890bcb..00000000 --- a/tests/mockserver/internal/sdk/models/components/department.go +++ /dev/null @@ -1,119 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type Department struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // Parent ID - ParentID *string `json:"parent_id,omitempty"` - // Department name - Name *string `json:"name,omitempty"` - Code *string `json:"code,omitempty"` - Description *string `json:"description,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (d Department) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(d, "", false) -} - -func (d *Department) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &d, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Department) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Department) GetParentID() *string { - if o == nil { - return nil - } - return o.ParentID -} - -func (o *Department) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *Department) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *Department) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *Department) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Department) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *Department) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *Department) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Department) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Department) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/departmentinput.go b/tests/mockserver/internal/sdk/models/components/departmentinput.go deleted file mode 100644 index 42386565..00000000 --- a/tests/mockserver/internal/sdk/models/components/departmentinput.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type DepartmentInput struct { - // Department name - Name *string `json:"name,omitempty"` - Code *string `json:"code,omitempty"` - Description *string `json:"description,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *DepartmentInput) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *DepartmentInput) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *DepartmentInput) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *DepartmentInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/deprecatedlinkedsupplier.go b/tests/mockserver/internal/sdk/models/components/deprecatedlinkedsupplier.go deleted file mode 100644 index 851a1b5b..00000000 --- a/tests/mockserver/internal/sdk/models/components/deprecatedlinkedsupplier.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeprecatedLinkedSupplier - The supplier this entity is linked to. -// -// Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. -type DeprecatedLinkedSupplier struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The display ID of the supplier. - DisplayID *string `json:"display_id,omitempty"` - // The display name of the supplier. - DisplayName *string `json:"display_name,omitempty"` - // The company name of the supplier. - CompanyName *string `json:"company_name,omitempty"` - Address *Address `json:"address,omitempty"` -} - -func (o *DeprecatedLinkedSupplier) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *DeprecatedLinkedSupplier) GetDisplayID() *string { - if o == nil { - return nil - } - return o.DisplayID -} - -func (o *DeprecatedLinkedSupplier) GetDisplayName() *string { - if o == nil { - return nil - } - return o.DisplayName -} - -func (o *DeprecatedLinkedSupplier) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *DeprecatedLinkedSupplier) GetAddress() *Address { - if o == nil { - return nil - } - return o.Address -} diff --git a/tests/mockserver/internal/sdk/models/components/deprecatedlinkedsupplierinput.go b/tests/mockserver/internal/sdk/models/components/deprecatedlinkedsupplierinput.go deleted file mode 100644 index 1863235e..00000000 --- a/tests/mockserver/internal/sdk/models/components/deprecatedlinkedsupplierinput.go +++ /dev/null @@ -1,26 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeprecatedLinkedSupplierInput - The supplier this entity is linked to. -// -// Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. -type DeprecatedLinkedSupplierInput struct { - // The display name of the supplier. - DisplayName *string `json:"display_name,omitempty"` - Address *Address `json:"address,omitempty"` -} - -func (o *DeprecatedLinkedSupplierInput) GetDisplayName() *string { - if o == nil { - return nil - } - return o.DisplayName -} - -func (o *DeprecatedLinkedSupplierInput) GetAddress() *Address { - if o == nil { - return nil - } - return o.Address -} diff --git a/tests/mockserver/internal/sdk/models/components/deprecatedlinkedtrackingcategory.go b/tests/mockserver/internal/sdk/models/components/deprecatedlinkedtrackingcategory.go deleted file mode 100644 index 8013a02b..00000000 --- a/tests/mockserver/internal/sdk/models/components/deprecatedlinkedtrackingcategory.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// DeprecatedLinkedTrackingCategory -// -// Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. -type DeprecatedLinkedTrackingCategory struct { - // The unique identifier for the tracking category. - ID *string `json:"id,omitempty"` - // The name of the tracking category. - Name *string `json:"name,omitempty"` -} - -func (o *DeprecatedLinkedTrackingCategory) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *DeprecatedLinkedTrackingCategory) GetName() *string { - if o == nil { - return nil - } - return o.Name -} diff --git a/tests/mockserver/internal/sdk/models/components/drive.go b/tests/mockserver/internal/sdk/models/components/drive.go deleted file mode 100644 index 18095d0b..00000000 --- a/tests/mockserver/internal/sdk/models/components/drive.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type Drive struct { - // A unique identifier for an object. - ID string `json:"id"` - // The name of the drive - Name string `json:"name"` - // A description of the object. - Description *string `json:"description,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (d Drive) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(d, "", false) -} - -func (d *Drive) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &d, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Drive) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *Drive) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *Drive) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *Drive) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Drive) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *Drive) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *Drive) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Drive) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Drive) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/drivegroup.go b/tests/mockserver/internal/sdk/models/components/drivegroup.go deleted file mode 100644 index 78178c94..00000000 --- a/tests/mockserver/internal/sdk/models/components/drivegroup.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type DriveGroup struct { - // A unique identifier for an object. - ID string `json:"id"` - // The name of the drive group - Name string `json:"name"` - // The display name of the drive group - DisplayName *string `json:"display_name,omitempty"` - // A description of the object. - Description *string `json:"description,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (d DriveGroup) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(d, "", false) -} - -func (d *DriveGroup) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &d, "", false, false); err != nil { - return err - } - return nil -} - -func (o *DriveGroup) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *DriveGroup) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *DriveGroup) GetDisplayName() *string { - if o == nil { - return nil - } - return o.DisplayName -} - -func (o *DriveGroup) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *DriveGroup) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *DriveGroup) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *DriveGroup) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *DriveGroup) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *DriveGroup) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *DriveGroup) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/drivegroupinput.go b/tests/mockserver/internal/sdk/models/components/drivegroupinput.go deleted file mode 100644 index 4c18e9a3..00000000 --- a/tests/mockserver/internal/sdk/models/components/drivegroupinput.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type DriveGroupInput struct { - // The name of the drive group - Name string `json:"name"` - // The display name of the drive group - DisplayName *string `json:"display_name,omitempty"` - // A description of the object. - Description *string `json:"description,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *DriveGroupInput) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *DriveGroupInput) GetDisplayName() *string { - if o == nil { - return nil - } - return o.DisplayName -} - -func (o *DriveGroupInput) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *DriveGroupInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/drivegroupsfilter.go b/tests/mockserver/internal/sdk/models/components/drivegroupsfilter.go deleted file mode 100644 index c0df512e..00000000 --- a/tests/mockserver/internal/sdk/models/components/drivegroupsfilter.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type DriveGroupsFilter struct { - // ID of the drive group to filter on - ParentGroupID *string `queryParam:"name=parent_group_id"` -} - -func (o *DriveGroupsFilter) GetParentGroupID() *string { - if o == nil { - return nil - } - return o.ParentGroupID -} diff --git a/tests/mockserver/internal/sdk/models/components/driveinput.go b/tests/mockserver/internal/sdk/models/components/driveinput.go deleted file mode 100644 index bb5e64e8..00000000 --- a/tests/mockserver/internal/sdk/models/components/driveinput.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type DriveInput struct { - // The name of the drive - Name string `json:"name"` - // A description of the object. - Description *string `json:"description,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *DriveInput) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *DriveInput) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *DriveInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/drivesfilter.go b/tests/mockserver/internal/sdk/models/components/drivesfilter.go deleted file mode 100644 index fcd9b4d1..00000000 --- a/tests/mockserver/internal/sdk/models/components/drivesfilter.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type DrivesFilter struct { - // ID of the drive group to filter on - GroupID *string `queryParam:"name=group_id"` -} - -func (o *DrivesFilter) GetGroupID() *string { - if o == nil { - return nil - } - return o.GroupID -} diff --git a/tests/mockserver/internal/sdk/models/components/ecommerceaddress.go b/tests/mockserver/internal/sdk/models/components/ecommerceaddress.go deleted file mode 100644 index 35b6388c..00000000 --- a/tests/mockserver/internal/sdk/models/components/ecommerceaddress.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// EcommerceAddress - An object representing a shipping or billing address. -type EcommerceAddress struct { - // Address line 1 of the billing address. - Line1 *string `json:"line1,omitempty"` - // Address line 2 of the billing address. - Line2 *string `json:"line2,omitempty"` - // Company name of the customer - CompanyName *string `json:"company_name,omitempty"` - // City of the billing address. - City *string `json:"city,omitempty"` - // State/province of the billing address. - State *string `json:"state,omitempty"` - // Postal/ZIP code of the billing address. - PostalCode *string `json:"postal_code,omitempty"` - // Country of the billing address. - Country *string `json:"country,omitempty"` -} - -func (o *EcommerceAddress) GetLine1() *string { - if o == nil { - return nil - } - return o.Line1 -} - -func (o *EcommerceAddress) GetLine2() *string { - if o == nil { - return nil - } - return o.Line2 -} - -func (o *EcommerceAddress) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *EcommerceAddress) GetCity() *string { - if o == nil { - return nil - } - return o.City -} - -func (o *EcommerceAddress) GetState() *string { - if o == nil { - return nil - } - return o.State -} - -func (o *EcommerceAddress) GetPostalCode() *string { - if o == nil { - return nil - } - return o.PostalCode -} - -func (o *EcommerceAddress) GetCountry() *string { - if o == nil { - return nil - } - return o.Country -} diff --git a/tests/mockserver/internal/sdk/models/components/ecommercecustomer.go b/tests/mockserver/internal/sdk/models/components/ecommercecustomer.go deleted file mode 100644 index a0ee94db..00000000 --- a/tests/mockserver/internal/sdk/models/components/ecommercecustomer.go +++ /dev/null @@ -1,279 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// EcommerceCustomerStatusCustomerStatus - The current status of the customer -type EcommerceCustomerStatusCustomerStatus string - -const ( - EcommerceCustomerStatusCustomerStatusActive EcommerceCustomerStatusCustomerStatus = "active" - EcommerceCustomerStatusCustomerStatusArchived EcommerceCustomerStatusCustomerStatus = "archived" -) - -func (e EcommerceCustomerStatusCustomerStatus) ToPointer() *EcommerceCustomerStatusCustomerStatus { - return &e -} -func (e *EcommerceCustomerStatusCustomerStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "active": - fallthrough - case "archived": - *e = EcommerceCustomerStatusCustomerStatus(v) - return nil - default: - return fmt.Errorf("invalid value for EcommerceCustomerStatusCustomerStatus: %v", v) - } -} - -type EcommerceCustomerType string - -const ( - EcommerceCustomerTypeBilling EcommerceCustomerType = "billing" - EcommerceCustomerTypeShipping EcommerceCustomerType = "shipping" - EcommerceCustomerTypeOther EcommerceCustomerType = "other" -) - -func (e EcommerceCustomerType) ToPointer() *EcommerceCustomerType { - return &e -} -func (e *EcommerceCustomerType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "billing": - fallthrough - case "shipping": - fallthrough - case "other": - *e = EcommerceCustomerType(v) - return nil - default: - return fmt.Errorf("invalid value for EcommerceCustomerType: %v", v) - } -} - -type EcommerceCustomerAddress struct { - Type *EcommerceCustomerType `json:"type,omitempty"` - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // First line of the street address of the customer - Line1 *string `json:"line1,omitempty"` - // Second line of the street address of the customer - Line2 *string `json:"line2,omitempty"` - // City of the customer - City *string `json:"city,omitempty"` - // State of the customer - State *string `json:"state,omitempty"` - // Postal code of the customer - PostalCode *string `json:"postal_code,omitempty"` - // Country of the customer - Country *string `json:"country,omitempty"` -} - -func (o *EcommerceCustomerAddress) GetType() *EcommerceCustomerType { - if o == nil { - return nil - } - return o.Type -} - -func (o *EcommerceCustomerAddress) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *EcommerceCustomerAddress) GetLine1() *string { - if o == nil { - return nil - } - return o.Line1 -} - -func (o *EcommerceCustomerAddress) GetLine2() *string { - if o == nil { - return nil - } - return o.Line2 -} - -func (o *EcommerceCustomerAddress) GetCity() *string { - if o == nil { - return nil - } - return o.City -} - -func (o *EcommerceCustomerAddress) GetState() *string { - if o == nil { - return nil - } - return o.State -} - -func (o *EcommerceCustomerAddress) GetPostalCode() *string { - if o == nil { - return nil - } - return o.PostalCode -} - -func (o *EcommerceCustomerAddress) GetCountry() *string { - if o == nil { - return nil - } - return o.Country -} - -type EcommerceCustomer struct { - // A unique identifier for an object. - ID string `json:"id"` - // Full name of the customer - Name *string `json:"name,omitempty"` - // First name of the customer - FirstName *string `json:"first_name,omitempty"` - // Last name of the customer - LastName *string `json:"last_name,omitempty"` - // Company name of the customer - CompanyName *string `json:"company_name,omitempty"` - // The current status of the customer - Status *EcommerceCustomerStatusCustomerStatus `json:"status,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"` - // An array of email addresses for the customer. - Emails []Email `json:"emails,omitempty"` - // An array of phone numbers for the customer. - PhoneNumbers []PhoneNumber `json:"phone_numbers,omitempty"` - // An array of addresses for the customer. - Addresses []EcommerceCustomerAddress `json:"addresses,omitempty"` - Orders []LinkedEcommerceOrder `json:"orders,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"` -} - -func (e EcommerceCustomer) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(e, "", false) -} - -func (e *EcommerceCustomer) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { - return err - } - return nil -} - -func (o *EcommerceCustomer) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *EcommerceCustomer) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *EcommerceCustomer) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *EcommerceCustomer) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *EcommerceCustomer) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *EcommerceCustomer) GetStatus() *EcommerceCustomerStatusCustomerStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *EcommerceCustomer) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *EcommerceCustomer) GetEmails() []Email { - if o == nil { - return nil - } - return o.Emails -} - -func (o *EcommerceCustomer) GetPhoneNumbers() []PhoneNumber { - if o == nil { - return nil - } - return o.PhoneNumbers -} - -func (o *EcommerceCustomer) GetAddresses() []EcommerceCustomerAddress { - if o == nil { - return nil - } - return o.Addresses -} - -func (o *EcommerceCustomer) GetOrders() []LinkedEcommerceOrder { - if o == nil { - return nil - } - return o.Orders -} - -func (o *EcommerceCustomer) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *EcommerceCustomer) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *EcommerceCustomer) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} diff --git a/tests/mockserver/internal/sdk/models/components/ecommercecustomersfilter.go b/tests/mockserver/internal/sdk/models/components/ecommercecustomersfilter.go deleted file mode 100644 index 01135c2e..00000000 --- a/tests/mockserver/internal/sdk/models/components/ecommercecustomersfilter.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type EcommerceCustomersFilter struct { - // Customer email address to filter on - Email *string `queryParam:"name=email"` - // Customer phone number to filter on - PhoneNumber *string `queryParam:"name=phone_number"` -} - -func (o *EcommerceCustomersFilter) GetEmail() *string { - if o == nil { - return nil - } - return o.Email -} - -func (o *EcommerceCustomersFilter) GetPhoneNumber() *string { - if o == nil { - return nil - } - return o.PhoneNumber -} diff --git a/tests/mockserver/internal/sdk/models/components/ecommercediscount.go b/tests/mockserver/internal/sdk/models/components/ecommercediscount.go deleted file mode 100644 index da37eec4..00000000 --- a/tests/mockserver/internal/sdk/models/components/ecommercediscount.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// EcommerceDiscount - An object representing a discount applied to an ecommerce order or product. -type EcommerceDiscount struct { - // The code used to apply the discount. - Code *string `json:"code,omitempty"` - // The fixed amount of the discount. - Amount *string `json:"amount,omitempty"` - // The percentage of the discount. - Percentage *string `json:"percentage,omitempty"` -} - -func (o *EcommerceDiscount) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *EcommerceDiscount) GetAmount() *string { - if o == nil { - return nil - } - return o.Amount -} - -func (o *EcommerceDiscount) GetPercentage() *string { - if o == nil { - return nil - } - return o.Percentage -} diff --git a/tests/mockserver/internal/sdk/models/components/ecommerceorder.go b/tests/mockserver/internal/sdk/models/components/ecommerceorder.go deleted file mode 100644 index 69e58467..00000000 --- a/tests/mockserver/internal/sdk/models/components/ecommerceorder.go +++ /dev/null @@ -1,329 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// EcommerceOrderPaymentStatus - Current payment status of the order. -type EcommerceOrderPaymentStatus string - -const ( - EcommerceOrderPaymentStatusPending EcommerceOrderPaymentStatus = "pending" - EcommerceOrderPaymentStatusAuthorized EcommerceOrderPaymentStatus = "authorized" - EcommerceOrderPaymentStatusPaid EcommerceOrderPaymentStatus = "paid" - EcommerceOrderPaymentStatusPartial EcommerceOrderPaymentStatus = "partial" - EcommerceOrderPaymentStatusRefunded EcommerceOrderPaymentStatus = "refunded" - EcommerceOrderPaymentStatusVoided EcommerceOrderPaymentStatus = "voided" - EcommerceOrderPaymentStatusUnknown EcommerceOrderPaymentStatus = "unknown" -) - -func (e EcommerceOrderPaymentStatus) ToPointer() *EcommerceOrderPaymentStatus { - return &e -} -func (e *EcommerceOrderPaymentStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "pending": - fallthrough - case "authorized": - fallthrough - case "paid": - fallthrough - case "partial": - fallthrough - case "refunded": - fallthrough - case "voided": - fallthrough - case "unknown": - *e = EcommerceOrderPaymentStatus(v) - return nil - default: - return fmt.Errorf("invalid value for EcommerceOrderPaymentStatus: %v", v) - } -} - -// FulfillmentStatus - Current fulfillment status of the order. -type FulfillmentStatus string - -const ( - FulfillmentStatusPending FulfillmentStatus = "pending" - FulfillmentStatusShipped FulfillmentStatus = "shipped" - FulfillmentStatusPartial FulfillmentStatus = "partial" - FulfillmentStatusDelivered FulfillmentStatus = "delivered" - FulfillmentStatusCancelled FulfillmentStatus = "cancelled" - FulfillmentStatusReturned FulfillmentStatus = "returned" - FulfillmentStatusUnknown FulfillmentStatus = "unknown" -) - -func (e FulfillmentStatus) ToPointer() *FulfillmentStatus { - return &e -} -func (e *FulfillmentStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "pending": - fallthrough - case "shipped": - fallthrough - case "partial": - fallthrough - case "delivered": - fallthrough - case "cancelled": - fallthrough - case "returned": - fallthrough - case "unknown": - *e = FulfillmentStatus(v) - return nil - default: - return fmt.Errorf("invalid value for FulfillmentStatus: %v", v) - } -} - -type EcommerceOrder struct { - // A unique identifier for an object. - ID string `json:"id"` - // Order number, if any. - OrderNumber *string `json:"order_number,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"` - Discounts []EcommerceDiscount `json:"discounts,omitempty"` - // Sub-total amount, normally before tax. - SubTotal *string `json:"sub_total,omitempty"` - // Shipping cost, if any. - ShippingCost *string `json:"shipping_cost,omitempty"` - // Coupon discount, if any. - CouponDiscount *string `json:"coupon_discount,omitempty"` - // Total discount, if any. - TotalDiscount *string `json:"total_discount,omitempty"` - // Total tax, if any. - TotalTax *string `json:"total_tax,omitempty"` - // Total amount due. - TotalAmount *string `json:"total_amount,omitempty"` - // Refunded amount, if any. - RefundedAmount *string `json:"refunded_amount,omitempty"` - // Current status of the order. - Status *EcommerceOrderStatus `json:"status,omitempty"` - // Current payment status of the order. - PaymentStatus *EcommerceOrderPaymentStatus `json:"payment_status,omitempty"` - // Current fulfillment status of the order. - FulfillmentStatus *FulfillmentStatus `json:"fulfillment_status,omitempty"` - // Payment method used for this order. - PaymentMethod *string `json:"payment_method,omitempty"` - // The customer this entity is linked to. - Customer *LinkedEcommerceCustomer `json:"customer,omitempty"` - // An object representing a shipping or billing address. - BillingAddress *EcommerceAddress `json:"billing_address,omitempty"` - // An object representing a shipping or billing address. - ShippingAddress *EcommerceAddress `json:"shipping_address,omitempty"` - Tracking []TrackingItem `json:"tracking,omitempty"` - LineItems []EcommerceOrderLineItem `json:"line_items,omitempty"` - // Note for the order. - Note *string `json:"note,omitempty"` - Refunds []EcommerceOrderRefund `json:"refunds,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"` -} - -func (e EcommerceOrder) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(e, "", false) -} - -func (e *EcommerceOrder) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { - return err - } - return nil -} - -func (o *EcommerceOrder) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *EcommerceOrder) GetOrderNumber() *string { - if o == nil { - return nil - } - return o.OrderNumber -} - -func (o *EcommerceOrder) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *EcommerceOrder) GetDiscounts() []EcommerceDiscount { - if o == nil { - return nil - } - return o.Discounts -} - -func (o *EcommerceOrder) GetSubTotal() *string { - if o == nil { - return nil - } - return o.SubTotal -} - -func (o *EcommerceOrder) GetShippingCost() *string { - if o == nil { - return nil - } - return o.ShippingCost -} - -func (o *EcommerceOrder) GetCouponDiscount() *string { - if o == nil { - return nil - } - return o.CouponDiscount -} - -func (o *EcommerceOrder) GetTotalDiscount() *string { - if o == nil { - return nil - } - return o.TotalDiscount -} - -func (o *EcommerceOrder) GetTotalTax() *string { - if o == nil { - return nil - } - return o.TotalTax -} - -func (o *EcommerceOrder) GetTotalAmount() *string { - if o == nil { - return nil - } - return o.TotalAmount -} - -func (o *EcommerceOrder) GetRefundedAmount() *string { - if o == nil { - return nil - } - return o.RefundedAmount -} - -func (o *EcommerceOrder) GetStatus() *EcommerceOrderStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *EcommerceOrder) GetPaymentStatus() *EcommerceOrderPaymentStatus { - if o == nil { - return nil - } - return o.PaymentStatus -} - -func (o *EcommerceOrder) GetFulfillmentStatus() *FulfillmentStatus { - if o == nil { - return nil - } - return o.FulfillmentStatus -} - -func (o *EcommerceOrder) GetPaymentMethod() *string { - if o == nil { - return nil - } - return o.PaymentMethod -} - -func (o *EcommerceOrder) GetCustomer() *LinkedEcommerceCustomer { - if o == nil { - return nil - } - return o.Customer -} - -func (o *EcommerceOrder) GetBillingAddress() *EcommerceAddress { - if o == nil { - return nil - } - return o.BillingAddress -} - -func (o *EcommerceOrder) GetShippingAddress() *EcommerceAddress { - if o == nil { - return nil - } - return o.ShippingAddress -} - -func (o *EcommerceOrder) GetTracking() []TrackingItem { - if o == nil { - return nil - } - return o.Tracking -} - -func (o *EcommerceOrder) GetLineItems() []EcommerceOrderLineItem { - if o == nil { - return nil - } - return o.LineItems -} - -func (o *EcommerceOrder) GetNote() *string { - if o == nil { - return nil - } - return o.Note -} - -func (o *EcommerceOrder) GetRefunds() []EcommerceOrderRefund { - if o == nil { - return nil - } - return o.Refunds -} - -func (o *EcommerceOrder) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *EcommerceOrder) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *EcommerceOrder) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} diff --git a/tests/mockserver/internal/sdk/models/components/ecommerceorderlineitem.go b/tests/mockserver/internal/sdk/models/components/ecommerceorderlineitem.go deleted file mode 100644 index 55e107d9..00000000 --- a/tests/mockserver/internal/sdk/models/components/ecommerceorderlineitem.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type EcommerceOrderLineItemOption struct { - // A unique identifier for the option. - ID *string `json:"id,omitempty"` - // The name of the option. - Name *string `json:"name,omitempty"` - // The value of the option. - Value *string `json:"value,omitempty"` -} - -func (o *EcommerceOrderLineItemOption) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *EcommerceOrderLineItemOption) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *EcommerceOrderLineItemOption) GetValue() *string { - if o == nil { - return nil - } - return o.Value -} - -// EcommerceOrderLineItem - A single line item of an ecommerce order, representing a product or variant with associated options, quantity, and pricing information. -type EcommerceOrderLineItem struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // A unique identifier for the product associated with the line item. - ProductID *string `json:"product_id,omitempty"` - // A unique identifier for the variant of the product associated with the line item, if applicable. - VariantID *string `json:"variant_id,omitempty"` - // The SKU of the product or variant associated with the line item. - Sku *string `json:"sku,omitempty"` - // The name of the product or variant associated with the line item. - Name *string `json:"name"` - // The description of the product or variant associated with the line item. - Description *string `json:"description,omitempty"` - Options []EcommerceOrderLineItemOption `json:"options,omitempty"` - // The quantity of the product or variant associated with the line item. - Quantity *string `json:"quantity"` - // The unit price of the product or variant associated with the line item. - UnitPrice *string `json:"unit_price,omitempty"` - // The tax rate applied to the product or variant associated with the line item. - TaxRate *string `json:"tax_rate,omitempty"` - // The total tax amount applied to the product or variant associated with the line item. - TaxAmount *string `json:"tax_amount,omitempty"` - // Whether the line item has been refunded. - IsRefunded *bool `json:"is_refunded,omitempty"` - // The amount of the line item that has been refunded. - RefundedAmount *string `json:"refunded_amount,omitempty"` - // The quantity of the line item that has been refunded. - RefundedQuantity *string `json:"refunded_quantity,omitempty"` - // The sub total for the product(s) or variant associated with the line item, excluding taxes and discounts. - SubTotal *string `json:"sub_total,omitempty"` - // The total amount for the product(s) or variant associated with the line item, including taxes and discounts. - TotalAmount *string `json:"total_amount,omitempty"` - Discounts []EcommerceDiscount `json:"discounts,omitempty"` -} - -func (o *EcommerceOrderLineItem) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *EcommerceOrderLineItem) GetProductID() *string { - if o == nil { - return nil - } - return o.ProductID -} - -func (o *EcommerceOrderLineItem) GetVariantID() *string { - if o == nil { - return nil - } - return o.VariantID -} - -func (o *EcommerceOrderLineItem) GetSku() *string { - if o == nil { - return nil - } - return o.Sku -} - -func (o *EcommerceOrderLineItem) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *EcommerceOrderLineItem) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *EcommerceOrderLineItem) GetOptions() []EcommerceOrderLineItemOption { - if o == nil { - return nil - } - return o.Options -} - -func (o *EcommerceOrderLineItem) GetQuantity() *string { - if o == nil { - return nil - } - return o.Quantity -} - -func (o *EcommerceOrderLineItem) GetUnitPrice() *string { - if o == nil { - return nil - } - return o.UnitPrice -} - -func (o *EcommerceOrderLineItem) GetTaxRate() *string { - if o == nil { - return nil - } - return o.TaxRate -} - -func (o *EcommerceOrderLineItem) GetTaxAmount() *string { - if o == nil { - return nil - } - return o.TaxAmount -} - -func (o *EcommerceOrderLineItem) GetIsRefunded() *bool { - if o == nil { - return nil - } - return o.IsRefunded -} - -func (o *EcommerceOrderLineItem) GetRefundedAmount() *string { - if o == nil { - return nil - } - return o.RefundedAmount -} - -func (o *EcommerceOrderLineItem) GetRefundedQuantity() *string { - if o == nil { - return nil - } - return o.RefundedQuantity -} - -func (o *EcommerceOrderLineItem) GetSubTotal() *string { - if o == nil { - return nil - } - return o.SubTotal -} - -func (o *EcommerceOrderLineItem) GetTotalAmount() *string { - if o == nil { - return nil - } - return o.TotalAmount -} - -func (o *EcommerceOrderLineItem) GetDiscounts() []EcommerceDiscount { - if o == nil { - return nil - } - return o.Discounts -} diff --git a/tests/mockserver/internal/sdk/models/components/ecommerceorderrefund.go b/tests/mockserver/internal/sdk/models/components/ecommerceorderrefund.go deleted file mode 100644 index 67838378..00000000 --- a/tests/mockserver/internal/sdk/models/components/ecommerceorderrefund.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -// EcommerceOrderRefund - A refund for an ecommerce order. -type EcommerceOrderRefund struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The amount of the refund. - Amount *string `json:"amount,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 reason for the refund. - Reason *string `json:"reason,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` -} - -func (e EcommerceOrderRefund) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(e, "", false) -} - -func (e *EcommerceOrderRefund) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { - return err - } - return nil -} - -func (o *EcommerceOrderRefund) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *EcommerceOrderRefund) GetAmount() *string { - if o == nil { - return nil - } - return o.Amount -} - -func (o *EcommerceOrderRefund) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *EcommerceOrderRefund) GetReason() *string { - if o == nil { - return nil - } - return o.Reason -} - -func (o *EcommerceOrderRefund) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} diff --git a/tests/mockserver/internal/sdk/models/components/ecommerceordersfilter.go b/tests/mockserver/internal/sdk/models/components/ecommerceordersfilter.go deleted file mode 100644 index f55f3e69..00000000 --- a/tests/mockserver/internal/sdk/models/components/ecommerceordersfilter.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type EcommerceOrdersFilter struct { - // Customer email address to filter on - Email *string `queryParam:"name=email"` - // Customer id to filter on - CustomerID *string `queryParam:"name=customer_id"` - // Minimum date the order was last modified - UpdatedSince *string `queryParam:"name=updated_since"` - // Minimum date the order was created - CreatedSince *string `queryParam:"name=created_since"` -} - -func (o *EcommerceOrdersFilter) GetEmail() *string { - if o == nil { - return nil - } - return o.Email -} - -func (o *EcommerceOrdersFilter) GetCustomerID() *string { - if o == nil { - return nil - } - return o.CustomerID -} - -func (o *EcommerceOrdersFilter) GetUpdatedSince() *string { - if o == nil { - return nil - } - return o.UpdatedSince -} - -func (o *EcommerceOrdersFilter) GetCreatedSince() *string { - if o == nil { - return nil - } - return o.CreatedSince -} diff --git a/tests/mockserver/internal/sdk/models/components/ecommerceorderstatus.go b/tests/mockserver/internal/sdk/models/components/ecommerceorderstatus.go deleted file mode 100644 index 5c58108d..00000000 --- a/tests/mockserver/internal/sdk/models/components/ecommerceorderstatus.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// EcommerceOrderStatus - Current status of the order. -type EcommerceOrderStatus string - -const ( - EcommerceOrderStatusActive EcommerceOrderStatus = "active" - EcommerceOrderStatusCompleted EcommerceOrderStatus = "completed" - EcommerceOrderStatusCancelled EcommerceOrderStatus = "cancelled" - EcommerceOrderStatusArchived EcommerceOrderStatus = "archived" - EcommerceOrderStatusUnknown EcommerceOrderStatus = "unknown" - EcommerceOrderStatusOther EcommerceOrderStatus = "other" -) - -func (e EcommerceOrderStatus) ToPointer() *EcommerceOrderStatus { - return &e -} -func (e *EcommerceOrderStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "active": - fallthrough - case "completed": - fallthrough - case "cancelled": - fallthrough - case "archived": - fallthrough - case "unknown": - fallthrough - case "other": - *e = EcommerceOrderStatus(v) - return nil - default: - return fmt.Errorf("invalid value for EcommerceOrderStatus: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/ecommerceproduct.go b/tests/mockserver/internal/sdk/models/components/ecommerceproduct.go deleted file mode 100644 index ec545fc0..00000000 --- a/tests/mockserver/internal/sdk/models/components/ecommerceproduct.go +++ /dev/null @@ -1,407 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// ProductStatus - The current status of the product (active or archived). -type ProductStatus string - -const ( - ProductStatusActive ProductStatus = "active" - ProductStatusArchived ProductStatus = "archived" -) - -func (e ProductStatus) ToPointer() *ProductStatus { - return &e -} -func (e *ProductStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "active": - fallthrough - case "archived": - *e = ProductStatus(v) - return nil - default: - return fmt.Errorf("invalid value for ProductStatus: %v", v) - } -} - -type Image struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The URL of an image of the product. - URL *string `json:"url,omitempty"` -} - -func (o *Image) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Image) GetURL() *string { - if o == nil { - return nil - } - return o.URL -} - -type EcommerceProductOption struct { - // A unique identifier for the option of the product. - ID *string `json:"id,omitempty"` - // The name of the option for the product. - Name *string `json:"name,omitempty"` - Values []*string `json:"values,omitempty"` -} - -func (o *EcommerceProductOption) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *EcommerceProductOption) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *EcommerceProductOption) GetValues() []*string { - if o == nil { - return nil - } - return o.Values -} - -type VariantOption struct { - // A unique identifier for the option of the variant. - ID *string `json:"id,omitempty"` - // The name of the option for the variant. - Name *string `json:"name,omitempty"` - // The value of the option for the variant. - Value *string `json:"value,omitempty"` -} - -func (o *VariantOption) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *VariantOption) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *VariantOption) GetValue() *string { - if o == nil { - return nil - } - return o.Value -} - -type VariantImage struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The URL of an image of the variant. - URL *string `json:"url,omitempty"` -} - -func (o *VariantImage) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *VariantImage) GetURL() *string { - if o == nil { - return nil - } - return o.URL -} - -type Variant struct { - // A unique identifier for the variant of the product. - ID *string `json:"id,omitempty"` - // The name for the variant, used for displaying to customers. - Name *string `json:"name,omitempty"` - // The price of the variant. - Price *string `json:"price,omitempty"` - // The stock keeping unit of the variant. - Sku *string `json:"sku,omitempty"` - // The quantity of the variant in stock. - InventoryQuantity *string `json:"inventory_quantity,omitempty"` - // The weight of the variant. - Weight *string `json:"weight,omitempty"` - // The unit of measurement for the weight of the variant. - WeightUnit *string `json:"weight_unit,omitempty"` - Options []VariantOption `json:"options,omitempty"` - Images []VariantImage `json:"images,omitempty"` -} - -func (o *Variant) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Variant) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *Variant) GetPrice() *string { - if o == nil { - return nil - } - return o.Price -} - -func (o *Variant) GetSku() *string { - if o == nil { - return nil - } - return o.Sku -} - -func (o *Variant) GetInventoryQuantity() *string { - if o == nil { - return nil - } - return o.InventoryQuantity -} - -func (o *Variant) GetWeight() *string { - if o == nil { - return nil - } - return o.Weight -} - -func (o *Variant) GetWeightUnit() *string { - if o == nil { - return nil - } - return o.WeightUnit -} - -func (o *Variant) GetOptions() []VariantOption { - if o == nil { - return nil - } - return o.Options -} - -func (o *Variant) GetImages() []VariantImage { - if o == nil { - return nil - } - return o.Images -} - -type EcommerceProductCategory struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The name of the category. - Name *string `json:"name,omitempty"` -} - -func (o *EcommerceProductCategory) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *EcommerceProductCategory) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -type EcommerceProduct struct { - // A unique identifier for an object. - ID string `json:"id"` - // The name of the product as it should be displayed to customers. - Name *string `json:"name,omitempty"` - // A detailed description of the product. - Description *string `json:"description,omitempty"` - // The current status of the product (active or archived). - Status *ProductStatus `json:"status,omitempty"` - // The price of the product. - Price *string `json:"price,omitempty"` - // The stock keeping unit of the product. - Sku *string `json:"sku,omitempty"` - // The quantity of the product in stock. - InventoryQuantity *string `json:"inventory_quantity,omitempty"` - // An array of image URLs for the product. - Images []Image `json:"images,omitempty"` - // The weight of the product. - Weight *string `json:"weight,omitempty"` - // The unit of measurement for the weight of the product. - WeightUnit *string `json:"weight_unit,omitempty"` - // An array of options for the product. - Options []EcommerceProductOption `json:"options,omitempty"` - Variants []Variant `json:"variants,omitempty"` - // An array of tags for the product, used for organization and searching. - Tags []*string `json:"tags,omitempty"` - // An array of categories for the product, used for organization and searching. - Categories []EcommerceProductCategory `json:"categories,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"` -} - -func (e EcommerceProduct) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(e, "", false) -} - -func (e *EcommerceProduct) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { - return err - } - return nil -} - -func (o *EcommerceProduct) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *EcommerceProduct) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *EcommerceProduct) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *EcommerceProduct) GetStatus() *ProductStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *EcommerceProduct) GetPrice() *string { - if o == nil { - return nil - } - return o.Price -} - -func (o *EcommerceProduct) GetSku() *string { - if o == nil { - return nil - } - return o.Sku -} - -func (o *EcommerceProduct) GetInventoryQuantity() *string { - if o == nil { - return nil - } - return o.InventoryQuantity -} - -func (o *EcommerceProduct) GetImages() []Image { - if o == nil { - return nil - } - return o.Images -} - -func (o *EcommerceProduct) GetWeight() *string { - if o == nil { - return nil - } - return o.Weight -} - -func (o *EcommerceProduct) GetWeightUnit() *string { - if o == nil { - return nil - } - return o.WeightUnit -} - -func (o *EcommerceProduct) GetOptions() []EcommerceProductOption { - if o == nil { - return nil - } - return o.Options -} - -func (o *EcommerceProduct) GetVariants() []Variant { - if o == nil { - return nil - } - return o.Variants -} - -func (o *EcommerceProduct) GetTags() []*string { - if o == nil { - return nil - } - return o.Tags -} - -func (o *EcommerceProduct) GetCategories() []EcommerceProductCategory { - if o == nil { - return nil - } - return o.Categories -} - -func (o *EcommerceProduct) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *EcommerceProduct) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *EcommerceProduct) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} diff --git a/tests/mockserver/internal/sdk/models/components/ecommercestore.go b/tests/mockserver/internal/sdk/models/components/ecommercestore.go deleted file mode 100644 index b57ea4f0..00000000 --- a/tests/mockserver/internal/sdk/models/components/ecommercestore.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type EcommerceStore struct { - // A unique identifier for an object. - ID string `json:"id"` - // The store's name - Name *string `json:"name,omitempty"` - // The store's website URL - StoreURL *string `json:"store_url,omitempty"` - // The store's admin login URL - AdminURL *string `json:"admin_url,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"` -} - -func (e EcommerceStore) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(e, "", false) -} - -func (e *EcommerceStore) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { - return err - } - return nil -} - -func (o *EcommerceStore) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *EcommerceStore) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *EcommerceStore) GetStoreURL() *string { - if o == nil { - return nil - } - return o.StoreURL -} - -func (o *EcommerceStore) GetAdminURL() *string { - if o == nil { - return nil - } - return o.AdminURL -} - -func (o *EcommerceStore) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *EcommerceStore) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *EcommerceStore) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} diff --git a/tests/mockserver/internal/sdk/models/components/email.go b/tests/mockserver/internal/sdk/models/components/email.go deleted file mode 100644 index f48a727b..00000000 --- a/tests/mockserver/internal/sdk/models/components/email.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// EmailType - Email type -type EmailType string - -const ( - EmailTypePrimary EmailType = "primary" - EmailTypeSecondary EmailType = "secondary" - EmailTypeWork EmailType = "work" - EmailTypePersonal EmailType = "personal" - EmailTypeBilling EmailType = "billing" - EmailTypeOther EmailType = "other" -) - -func (e EmailType) ToPointer() *EmailType { - return &e -} -func (e *EmailType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "primary": - fallthrough - case "secondary": - fallthrough - case "work": - fallthrough - case "personal": - fallthrough - case "billing": - fallthrough - case "other": - *e = EmailType(v) - return nil - default: - return fmt.Errorf("invalid value for EmailType: %v", v) - } -} - -type Email struct { - // Unique identifier for the email address - ID *string `json:"id,omitempty"` - // Email address - Email *string `json:"email"` - // Email type - Type *EmailType `json:"type,omitempty"` -} - -func (o *Email) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Email) GetEmail() *string { - if o == nil { - return nil - } - return o.Email -} - -func (o *Email) GetType() *EmailType { - if o == nil { - return nil - } - return o.Type -} diff --git a/tests/mockserver/internal/sdk/models/components/employee.go b/tests/mockserver/internal/sdk/models/components/employee.go deleted file mode 100644 index 449067d7..00000000 --- a/tests/mockserver/internal/sdk/models/components/employee.go +++ /dev/null @@ -1,1377 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/types" - "mockserver/internal/sdk/utils" - "time" -) - -// LeavingReason - The reason because the employment ended. -type LeavingReason string - -const ( - LeavingReasonDismissed LeavingReason = "dismissed" - LeavingReasonResigned LeavingReason = "resigned" - LeavingReasonRedundancy LeavingReason = "redundancy" - LeavingReasonOther LeavingReason = "other" -) - -func (e LeavingReason) ToPointer() *LeavingReason { - return &e -} -func (e *LeavingReason) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "dismissed": - fallthrough - case "resigned": - fallthrough - case "redundancy": - fallthrough - case "other": - *e = LeavingReason(v) - return nil - default: - return fmt.Errorf("invalid value for LeavingReason: %v", v) - } -} - -// EmploymentType - The type of employment relationship the employee has with the organization. -type EmploymentType string - -const ( - EmploymentTypeContractor EmploymentType = "contractor" - EmploymentTypeEmployee EmploymentType = "employee" - EmploymentTypeFreelance EmploymentType = "freelance" - EmploymentTypeTemp EmploymentType = "temp" - EmploymentTypeInternship EmploymentType = "internship" - EmploymentTypeOther EmploymentType = "other" -) - -func (e EmploymentType) ToPointer() *EmploymentType { - return &e -} -func (e *EmploymentType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "contractor": - fallthrough - case "employee": - fallthrough - case "freelance": - fallthrough - case "temp": - fallthrough - case "internship": - fallthrough - case "other": - *e = EmploymentType(v) - return nil - default: - return fmt.Errorf("invalid value for EmploymentType: %v", v) - } -} - -// EmploymentSubType - The work schedule of the employee. -type EmploymentSubType string - -const ( - EmploymentSubTypeFullTime EmploymentSubType = "full_time" - EmploymentSubTypePartTime EmploymentSubType = "part_time" - EmploymentSubTypeHourly EmploymentSubType = "hourly" - EmploymentSubTypeOther EmploymentSubType = "other" - EmploymentSubTypeNotSpecified EmploymentSubType = "not_specified" -) - -func (e EmploymentSubType) ToPointer() *EmploymentSubType { - return &e -} -func (e *EmploymentSubType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "full_time": - fallthrough - case "part_time": - fallthrough - case "hourly": - fallthrough - case "other": - fallthrough - case "not_specified": - *e = EmploymentSubType(v) - return nil - default: - return fmt.Errorf("invalid value for EmploymentSubType: %v", v) - } -} - -type EmploymentRole struct { - // The type of employment relationship the employee has with the organization. - Type *EmploymentType `json:"type,omitempty"` - // The work schedule of the employee. - SubType *EmploymentSubType `json:"sub_type,omitempty"` -} - -func (o *EmploymentRole) GetType() *EmploymentType { - if o == nil { - return nil - } - return o.Type -} - -func (o *EmploymentRole) GetSubType() *EmploymentSubType { - if o == nil { - return nil - } - return o.SubType -} - -type Manager struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The name of the manager, often a combination of their first and last names. - Name *string `json:"name,omitempty"` - // The first name of the person. - FirstName *string `json:"first_name,omitempty"` - // The last name of the person. - LastName *string `json:"last_name,omitempty"` - // The email address of the manager. - Email *string `json:"email,omitempty"` - // The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. - EmploymentStatus *EmploymentStatus `json:"employment_status,omitempty"` -} - -func (o *Manager) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Manager) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *Manager) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *Manager) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *Manager) GetEmail() *string { - if o == nil { - return nil - } - return o.Email -} - -func (o *Manager) GetEmploymentStatus() *EmploymentStatus { - if o == nil { - return nil - } - return o.EmploymentStatus -} - -type ProbationPeriod struct { - // The date that the employee started their probation period at the company. - StartDate *types.Date `json:"start_date,omitempty"` - // The date that the employee ended their probation period at the company. - EndDate *types.Date `json:"end_date,omitempty"` -} - -func (p ProbationPeriod) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *ProbationPeriod) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ProbationPeriod) GetStartDate() *types.Date { - if o == nil { - return nil - } - return o.StartDate -} - -func (o *ProbationPeriod) GetEndDate() *types.Date { - if o == nil { - return nil - } - return o.EndDate -} - -type Employee struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The third-party API ID of original entity - DownstreamID *string `json:"downstream_id,omitempty"` - // The first name of the person. - FirstName *string `json:"first_name,omitempty"` - // The last name of the person. - LastName *string `json:"last_name,omitempty"` - // Middle name of the person. - MiddleName *string `json:"middle_name,omitempty"` - // The name used to display the employee, often a combination of their first and last names. - DisplayName *string `json:"display_name,omitempty"` - // The name the employee prefers to be addressed by, which may be different from their legal name. - PreferredName *string `json:"preferred_name,omitempty"` - // The initials of the person, usually derived from their first, middle, and last names. - Initials *string `json:"initials,omitempty"` - // A formal salutation for the person. For example, 'Mr', 'Mrs' - Salutation *string `json:"salutation,omitempty"` - // The job title of the person. - Title *string `json:"title,omitempty"` - // The marital status of the employee. - MaritalStatus *string `json:"marital_status,omitempty"` - Partner *Person `json:"partner,omitempty"` - // The division the person is currently in. Usually a collection of departments or teams or regions. - Division *string `json:"division,omitempty"` - // Unique identifier of the division this employee belongs to. - DivisionID *string `json:"division_id,omitempty"` - // The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. - // - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - Department *string `json:"department,omitempty"` - // Unique identifier of the department ID this employee belongs to. - DepartmentID *string `json:"department_id,omitempty"` - // Name of the department this employee belongs to. - DepartmentName *string `json:"department_name,omitempty"` - // The team the person is currently in. - Team *Team `json:"team,omitempty"` - // The unique identifier of the company. - CompanyID *string `json:"company_id,omitempty"` - // The name of the company. - CompanyName *string `json:"company_name,omitempty"` - // A Start Date is the date that the employee started working at the company - EmploymentStartDate *string `json:"employment_start_date,omitempty"` - // An End Date is the date that the employee ended working at the company - EmploymentEndDate *string `json:"employment_end_date,omitempty"` - // The reason because the employment ended. - LeavingReason *LeavingReason `json:"leaving_reason,omitempty"` - // An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. - EmployeeNumber *string `json:"employee_number,omitempty"` - // The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. - EmploymentStatus *EmploymentStatus `json:"employment_status,omitempty"` - EmploymentRole *EmploymentRole `json:"employment_role,omitempty"` - // The ethnicity of the employee - Ethnicity *string `json:"ethnicity,omitempty"` - Manager *Manager `json:"manager,omitempty"` - // Direct reports is an array of ids that reflect the individuals in an organizational hierarchy who are directly supervised by this specific employee. - DirectReports []string `json:"direct_reports,omitempty"` - // A unique identifier assigned by the government. This field is considered sensitive information and may be subject to special security and privacy restrictions. - SocialSecurityNumber *string `json:"social_security_number,omitempty"` - // The date of birth of the person. - Birthday *types.Date `json:"birthday,omitempty"` - // The date the person deceased. - DeceasedOn *types.Date `json:"deceased_on,omitempty"` - // Country code according to ISO 3166-1 alpha-2. - CountryOfBirth *string `json:"country_of_birth,omitempty"` - // A description of the object. - Description *string `json:"description,omitempty"` - // The gender represents the gender identity of a person. - Gender *Gender `json:"gender,omitempty"` - // The preferred pronouns of the person. - Pronouns *string `json:"pronouns,omitempty"` - // language code according to ISO 639-1. For the United States - EN - PreferredLanguage *string `json:"preferred_language,omitempty"` - Languages []*string `json:"languages,omitempty"` - Nationalities []*string `json:"nationalities,omitempty"` - // The URL of the photo of a person. - PhotoURL *string `json:"photo_url,omitempty"` - // The time zone related to the resource. The value is a string containing a standard time zone identifier, e.g. Europe/London. - Timezone *string `json:"timezone,omitempty"` - // When the employee is imported as a new hire, this field indicates what system (e.g. the name of the ATS) this employee was imported from. - Source *string `json:"source,omitempty"` - // Unique identifier of the employee in the system this employee was imported from (e.g. the ID in the ATS). - SourceID *string `json:"source_id,omitempty"` - RecordURL *string `json:"record_url,omitempty"` - Jobs []EmployeeJob `json:"jobs,omitempty"` - Compensations []EmployeeCompensation `json:"compensations,omitempty"` - // Indicates if the employee works from a remote location. - WorksRemote *bool `json:"works_remote,omitempty"` - Addresses []Address `json:"addresses,omitempty"` - PhoneNumbers []PhoneNumber `json:"phone_numbers,omitempty"` - Emails []Email `json:"emails,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - SocialLinks []SocialLink `json:"social_links,omitempty"` - BankAccounts []BankAccount `json:"bank_accounts,omitempty"` - TaxCode *string `json:"tax_code,omitempty"` - TaxID *string `json:"tax_id,omitempty"` - // Indicate the employee's dietary preference. - DietaryPreference *string `json:"dietary_preference,omitempty"` - // Indicate the employee's food allergies. - FoodAllergies []string `json:"food_allergies,omitempty"` - ProbationPeriod *ProbationPeriod `json:"probation_period,omitempty"` - Tags []string `json:"tags,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // Flag to indicate if the object is deleted. - Deleted *bool `json:"deleted,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (e Employee) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(e, "", false) -} - -func (e *Employee) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Employee) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Employee) GetDownstreamID() *string { - if o == nil { - return nil - } - return o.DownstreamID -} - -func (o *Employee) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *Employee) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *Employee) GetMiddleName() *string { - if o == nil { - return nil - } - return o.MiddleName -} - -func (o *Employee) GetDisplayName() *string { - if o == nil { - return nil - } - return o.DisplayName -} - -func (o *Employee) GetPreferredName() *string { - if o == nil { - return nil - } - return o.PreferredName -} - -func (o *Employee) GetInitials() *string { - if o == nil { - return nil - } - return o.Initials -} - -func (o *Employee) GetSalutation() *string { - if o == nil { - return nil - } - return o.Salutation -} - -func (o *Employee) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *Employee) GetMaritalStatus() *string { - if o == nil { - return nil - } - return o.MaritalStatus -} - -func (o *Employee) GetPartner() *Person { - if o == nil { - return nil - } - return o.Partner -} - -func (o *Employee) GetDivision() *string { - if o == nil { - return nil - } - return o.Division -} - -func (o *Employee) GetDivisionID() *string { - if o == nil { - return nil - } - return o.DivisionID -} - -func (o *Employee) GetDepartment() *string { - if o == nil { - return nil - } - return o.Department -} - -func (o *Employee) GetDepartmentID() *string { - if o == nil { - return nil - } - return o.DepartmentID -} - -func (o *Employee) GetDepartmentName() *string { - if o == nil { - return nil - } - return o.DepartmentName -} - -func (o *Employee) GetTeam() *Team { - if o == nil { - return nil - } - return o.Team -} - -func (o *Employee) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *Employee) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *Employee) GetEmploymentStartDate() *string { - if o == nil { - return nil - } - return o.EmploymentStartDate -} - -func (o *Employee) GetEmploymentEndDate() *string { - if o == nil { - return nil - } - return o.EmploymentEndDate -} - -func (o *Employee) GetLeavingReason() *LeavingReason { - if o == nil { - return nil - } - return o.LeavingReason -} - -func (o *Employee) GetEmployeeNumber() *string { - if o == nil { - return nil - } - return o.EmployeeNumber -} - -func (o *Employee) GetEmploymentStatus() *EmploymentStatus { - if o == nil { - return nil - } - return o.EmploymentStatus -} - -func (o *Employee) GetEmploymentRole() *EmploymentRole { - if o == nil { - return nil - } - return o.EmploymentRole -} - -func (o *Employee) GetEthnicity() *string { - if o == nil { - return nil - } - return o.Ethnicity -} - -func (o *Employee) GetManager() *Manager { - if o == nil { - return nil - } - return o.Manager -} - -func (o *Employee) GetDirectReports() []string { - if o == nil { - return nil - } - return o.DirectReports -} - -func (o *Employee) GetSocialSecurityNumber() *string { - if o == nil { - return nil - } - return o.SocialSecurityNumber -} - -func (o *Employee) GetBirthday() *types.Date { - if o == nil { - return nil - } - return o.Birthday -} - -func (o *Employee) GetDeceasedOn() *types.Date { - if o == nil { - return nil - } - return o.DeceasedOn -} - -func (o *Employee) GetCountryOfBirth() *string { - if o == nil { - return nil - } - return o.CountryOfBirth -} - -func (o *Employee) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *Employee) GetGender() *Gender { - if o == nil { - return nil - } - return o.Gender -} - -func (o *Employee) GetPronouns() *string { - if o == nil { - return nil - } - return o.Pronouns -} - -func (o *Employee) GetPreferredLanguage() *string { - if o == nil { - return nil - } - return o.PreferredLanguage -} - -func (o *Employee) GetLanguages() []*string { - if o == nil { - return nil - } - return o.Languages -} - -func (o *Employee) GetNationalities() []*string { - if o == nil { - return nil - } - return o.Nationalities -} - -func (o *Employee) GetPhotoURL() *string { - if o == nil { - return nil - } - return o.PhotoURL -} - -func (o *Employee) GetTimezone() *string { - if o == nil { - return nil - } - return o.Timezone -} - -func (o *Employee) GetSource() *string { - if o == nil { - return nil - } - return o.Source -} - -func (o *Employee) GetSourceID() *string { - if o == nil { - return nil - } - return o.SourceID -} - -func (o *Employee) GetRecordURL() *string { - if o == nil { - return nil - } - return o.RecordURL -} - -func (o *Employee) GetJobs() []EmployeeJob { - if o == nil { - return nil - } - return o.Jobs -} - -func (o *Employee) GetCompensations() []EmployeeCompensation { - if o == nil { - return nil - } - return o.Compensations -} - -func (o *Employee) GetWorksRemote() *bool { - if o == nil { - return nil - } - return o.WorksRemote -} - -func (o *Employee) GetAddresses() []Address { - if o == nil { - return nil - } - return o.Addresses -} - -func (o *Employee) GetPhoneNumbers() []PhoneNumber { - if o == nil { - return nil - } - return o.PhoneNumbers -} - -func (o *Employee) GetEmails() []Email { - if o == nil { - return nil - } - return o.Emails -} - -func (o *Employee) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *Employee) GetSocialLinks() []SocialLink { - if o == nil { - return nil - } - return o.SocialLinks -} - -func (o *Employee) GetBankAccounts() []BankAccount { - if o == nil { - return nil - } - return o.BankAccounts -} - -func (o *Employee) GetTaxCode() *string { - if o == nil { - return nil - } - return o.TaxCode -} - -func (o *Employee) GetTaxID() *string { - if o == nil { - return nil - } - return o.TaxID -} - -func (o *Employee) GetDietaryPreference() *string { - if o == nil { - return nil - } - return o.DietaryPreference -} - -func (o *Employee) GetFoodAllergies() []string { - if o == nil { - return nil - } - return o.FoodAllergies -} - -func (o *Employee) GetProbationPeriod() *ProbationPeriod { - if o == nil { - return nil - } - return o.ProbationPeriod -} - -func (o *Employee) GetTags() []string { - if o == nil { - return nil - } - return o.Tags -} - -func (o *Employee) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Employee) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *Employee) GetDeleted() *bool { - if o == nil { - return nil - } - return o.Deleted -} - -func (o *Employee) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *Employee) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *Employee) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Employee) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Employee) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type EmployeeInput struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The first name of the person. - FirstName *string `json:"first_name,omitempty"` - // The last name of the person. - LastName *string `json:"last_name,omitempty"` - // Middle name of the person. - MiddleName *string `json:"middle_name,omitempty"` - // The name used to display the employee, often a combination of their first and last names. - DisplayName *string `json:"display_name,omitempty"` - // The name the employee prefers to be addressed by, which may be different from their legal name. - PreferredName *string `json:"preferred_name,omitempty"` - // The initials of the person, usually derived from their first, middle, and last names. - Initials *string `json:"initials,omitempty"` - // A formal salutation for the person. For example, 'Mr', 'Mrs' - Salutation *string `json:"salutation,omitempty"` - // The job title of the person. - Title *string `json:"title,omitempty"` - // The marital status of the employee. - MaritalStatus *string `json:"marital_status,omitempty"` - Partner *PersonInput `json:"partner,omitempty"` - // The division the person is currently in. Usually a collection of departments or teams or regions. - Division *string `json:"division,omitempty"` - // Unique identifier of the division this employee belongs to. - DivisionID *string `json:"division_id,omitempty"` - // The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. - // - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - Department *string `json:"department,omitempty"` - // Unique identifier of the department ID this employee belongs to. - DepartmentID *string `json:"department_id,omitempty"` - // Name of the department this employee belongs to. - DepartmentName *string `json:"department_name,omitempty"` - // The team the person is currently in. - Team *Team `json:"team,omitempty"` - // The unique identifier of the company. - CompanyID *string `json:"company_id,omitempty"` - // The name of the company. - CompanyName *string `json:"company_name,omitempty"` - // A Start Date is the date that the employee started working at the company - EmploymentStartDate *string `json:"employment_start_date,omitempty"` - // An End Date is the date that the employee ended working at the company - EmploymentEndDate *string `json:"employment_end_date,omitempty"` - // The reason because the employment ended. - LeavingReason *LeavingReason `json:"leaving_reason,omitempty"` - // An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. - EmployeeNumber *string `json:"employee_number,omitempty"` - // The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. - EmploymentStatus *EmploymentStatus `json:"employment_status,omitempty"` - EmploymentRole *EmploymentRole `json:"employment_role,omitempty"` - // The ethnicity of the employee - Ethnicity *string `json:"ethnicity,omitempty"` - Manager *Manager `json:"manager,omitempty"` - // Direct reports is an array of ids that reflect the individuals in an organizational hierarchy who are directly supervised by this specific employee. - DirectReports []string `json:"direct_reports,omitempty"` - // A unique identifier assigned by the government. This field is considered sensitive information and may be subject to special security and privacy restrictions. - SocialSecurityNumber *string `json:"social_security_number,omitempty"` - // The date of birth of the person. - Birthday *types.Date `json:"birthday,omitempty"` - // The date the person deceased. - DeceasedOn *types.Date `json:"deceased_on,omitempty"` - // Country code according to ISO 3166-1 alpha-2. - CountryOfBirth *string `json:"country_of_birth,omitempty"` - // A description of the object. - Description *string `json:"description,omitempty"` - // The gender represents the gender identity of a person. - Gender *Gender `json:"gender,omitempty"` - // The preferred pronouns of the person. - Pronouns *string `json:"pronouns,omitempty"` - // language code according to ISO 639-1. For the United States - EN - PreferredLanguage *string `json:"preferred_language,omitempty"` - Languages []*string `json:"languages,omitempty"` - Nationalities []*string `json:"nationalities,omitempty"` - // The URL of the photo of a person. - PhotoURL *string `json:"photo_url,omitempty"` - // The time zone related to the resource. The value is a string containing a standard time zone identifier, e.g. Europe/London. - Timezone *string `json:"timezone,omitempty"` - // When the employee is imported as a new hire, this field indicates what system (e.g. the name of the ATS) this employee was imported from. - Source *string `json:"source,omitempty"` - // Unique identifier of the employee in the system this employee was imported from (e.g. the ID in the ATS). - SourceID *string `json:"source_id,omitempty"` - RecordURL *string `json:"record_url,omitempty"` - Jobs []EmployeeJobInput `json:"jobs,omitempty"` - Compensations []EmployeeCompensationInput `json:"compensations,omitempty"` - // Indicates if the employee works from a remote location. - WorksRemote *bool `json:"works_remote,omitempty"` - Addresses []Address `json:"addresses,omitempty"` - PhoneNumbers []PhoneNumber `json:"phone_numbers,omitempty"` - Emails []Email `json:"emails,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - SocialLinks []SocialLink `json:"social_links,omitempty"` - BankAccounts []BankAccount `json:"bank_accounts,omitempty"` - TaxCode *string `json:"tax_code,omitempty"` - TaxID *string `json:"tax_id,omitempty"` - // Indicate the employee's dietary preference. - DietaryPreference *string `json:"dietary_preference,omitempty"` - // Indicate the employee's food allergies. - FoodAllergies []string `json:"food_allergies,omitempty"` - ProbationPeriod *ProbationPeriod `json:"probation_period,omitempty"` - Tags []string `json:"tags,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // Flag to indicate if the object is deleted. - Deleted *bool `json:"deleted,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (e EmployeeInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(e, "", false) -} - -func (e *EmployeeInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { - return err - } - return nil -} - -func (o *EmployeeInput) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *EmployeeInput) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *EmployeeInput) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *EmployeeInput) GetMiddleName() *string { - if o == nil { - return nil - } - return o.MiddleName -} - -func (o *EmployeeInput) GetDisplayName() *string { - if o == nil { - return nil - } - return o.DisplayName -} - -func (o *EmployeeInput) GetPreferredName() *string { - if o == nil { - return nil - } - return o.PreferredName -} - -func (o *EmployeeInput) GetInitials() *string { - if o == nil { - return nil - } - return o.Initials -} - -func (o *EmployeeInput) GetSalutation() *string { - if o == nil { - return nil - } - return o.Salutation -} - -func (o *EmployeeInput) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *EmployeeInput) GetMaritalStatus() *string { - if o == nil { - return nil - } - return o.MaritalStatus -} - -func (o *EmployeeInput) GetPartner() *PersonInput { - if o == nil { - return nil - } - return o.Partner -} - -func (o *EmployeeInput) GetDivision() *string { - if o == nil { - return nil - } - return o.Division -} - -func (o *EmployeeInput) GetDivisionID() *string { - if o == nil { - return nil - } - return o.DivisionID -} - -func (o *EmployeeInput) GetDepartment() *string { - if o == nil { - return nil - } - return o.Department -} - -func (o *EmployeeInput) GetDepartmentID() *string { - if o == nil { - return nil - } - return o.DepartmentID -} - -func (o *EmployeeInput) GetDepartmentName() *string { - if o == nil { - return nil - } - return o.DepartmentName -} - -func (o *EmployeeInput) GetTeam() *Team { - if o == nil { - return nil - } - return o.Team -} - -func (o *EmployeeInput) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *EmployeeInput) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *EmployeeInput) GetEmploymentStartDate() *string { - if o == nil { - return nil - } - return o.EmploymentStartDate -} - -func (o *EmployeeInput) GetEmploymentEndDate() *string { - if o == nil { - return nil - } - return o.EmploymentEndDate -} - -func (o *EmployeeInput) GetLeavingReason() *LeavingReason { - if o == nil { - return nil - } - return o.LeavingReason -} - -func (o *EmployeeInput) GetEmployeeNumber() *string { - if o == nil { - return nil - } - return o.EmployeeNumber -} - -func (o *EmployeeInput) GetEmploymentStatus() *EmploymentStatus { - if o == nil { - return nil - } - return o.EmploymentStatus -} - -func (o *EmployeeInput) GetEmploymentRole() *EmploymentRole { - if o == nil { - return nil - } - return o.EmploymentRole -} - -func (o *EmployeeInput) GetEthnicity() *string { - if o == nil { - return nil - } - return o.Ethnicity -} - -func (o *EmployeeInput) GetManager() *Manager { - if o == nil { - return nil - } - return o.Manager -} - -func (o *EmployeeInput) GetDirectReports() []string { - if o == nil { - return nil - } - return o.DirectReports -} - -func (o *EmployeeInput) GetSocialSecurityNumber() *string { - if o == nil { - return nil - } - return o.SocialSecurityNumber -} - -func (o *EmployeeInput) GetBirthday() *types.Date { - if o == nil { - return nil - } - return o.Birthday -} - -func (o *EmployeeInput) GetDeceasedOn() *types.Date { - if o == nil { - return nil - } - return o.DeceasedOn -} - -func (o *EmployeeInput) GetCountryOfBirth() *string { - if o == nil { - return nil - } - return o.CountryOfBirth -} - -func (o *EmployeeInput) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *EmployeeInput) GetGender() *Gender { - if o == nil { - return nil - } - return o.Gender -} - -func (o *EmployeeInput) GetPronouns() *string { - if o == nil { - return nil - } - return o.Pronouns -} - -func (o *EmployeeInput) GetPreferredLanguage() *string { - if o == nil { - return nil - } - return o.PreferredLanguage -} - -func (o *EmployeeInput) GetLanguages() []*string { - if o == nil { - return nil - } - return o.Languages -} - -func (o *EmployeeInput) GetNationalities() []*string { - if o == nil { - return nil - } - return o.Nationalities -} - -func (o *EmployeeInput) GetPhotoURL() *string { - if o == nil { - return nil - } - return o.PhotoURL -} - -func (o *EmployeeInput) GetTimezone() *string { - if o == nil { - return nil - } - return o.Timezone -} - -func (o *EmployeeInput) GetSource() *string { - if o == nil { - return nil - } - return o.Source -} - -func (o *EmployeeInput) GetSourceID() *string { - if o == nil { - return nil - } - return o.SourceID -} - -func (o *EmployeeInput) GetRecordURL() *string { - if o == nil { - return nil - } - return o.RecordURL -} - -func (o *EmployeeInput) GetJobs() []EmployeeJobInput { - if o == nil { - return nil - } - return o.Jobs -} - -func (o *EmployeeInput) GetCompensations() []EmployeeCompensationInput { - if o == nil { - return nil - } - return o.Compensations -} - -func (o *EmployeeInput) GetWorksRemote() *bool { - if o == nil { - return nil - } - return o.WorksRemote -} - -func (o *EmployeeInput) GetAddresses() []Address { - if o == nil { - return nil - } - return o.Addresses -} - -func (o *EmployeeInput) GetPhoneNumbers() []PhoneNumber { - if o == nil { - return nil - } - return o.PhoneNumbers -} - -func (o *EmployeeInput) GetEmails() []Email { - if o == nil { - return nil - } - return o.Emails -} - -func (o *EmployeeInput) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *EmployeeInput) GetSocialLinks() []SocialLink { - if o == nil { - return nil - } - return o.SocialLinks -} - -func (o *EmployeeInput) GetBankAccounts() []BankAccount { - if o == nil { - return nil - } - return o.BankAccounts -} - -func (o *EmployeeInput) GetTaxCode() *string { - if o == nil { - return nil - } - return o.TaxCode -} - -func (o *EmployeeInput) GetTaxID() *string { - if o == nil { - return nil - } - return o.TaxID -} - -func (o *EmployeeInput) GetDietaryPreference() *string { - if o == nil { - return nil - } - return o.DietaryPreference -} - -func (o *EmployeeInput) GetFoodAllergies() []string { - if o == nil { - return nil - } - return o.FoodAllergies -} - -func (o *EmployeeInput) GetProbationPeriod() *ProbationPeriod { - if o == nil { - return nil - } - return o.ProbationPeriod -} - -func (o *EmployeeInput) GetTags() []string { - if o == nil { - return nil - } - return o.Tags -} - -func (o *EmployeeInput) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *EmployeeInput) GetDeleted() *bool { - if o == nil { - return nil - } - return o.Deleted -} - -func (o *EmployeeInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/employeecompensation.go b/tests/mockserver/internal/sdk/models/components/employeecompensation.go deleted file mode 100644 index a7e637dc..00000000 --- a/tests/mockserver/internal/sdk/models/components/employeecompensation.go +++ /dev/null @@ -1,176 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// FlsaStatus - The FLSA status for this compensation. -type FlsaStatus string - -const ( - FlsaStatusExempt FlsaStatus = "exempt" - FlsaStatusSalariedNonexempt FlsaStatus = "salaried-nonexempt" - FlsaStatusNonexempt FlsaStatus = "nonexempt" - FlsaStatusOwner FlsaStatus = "owner" - FlsaStatusOther FlsaStatus = "other" -) - -func (e FlsaStatus) ToPointer() *FlsaStatus { - return &e -} -func (e *FlsaStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "exempt": - fallthrough - case "salaried-nonexempt": - fallthrough - case "nonexempt": - fallthrough - case "owner": - fallthrough - case "other": - *e = FlsaStatus(v) - return nil - default: - return fmt.Errorf("invalid value for FlsaStatus: %v", v) - } -} - -type EmployeeCompensation struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The ID of the job to which the compensation belongs. - JobID *string `json:"job_id,omitempty"` - // The amount paid per payment unit. - Rate *float64 `json:"rate,omitempty"` - // Unit of measurement for employee compensation. - PaymentUnit *PaymentUnit `json:"payment_unit,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 FLSA status for this compensation. - FlsaStatus *FlsaStatus `json:"flsa_status,omitempty"` - // The date on which a change to an employee's compensation takes effect. - EffectiveDate *string `json:"effective_date,omitempty"` - // Frequency of employee compensation. - PaymentFrequency *PaymentFrequency `json:"payment_frequency,omitempty"` -} - -func (o *EmployeeCompensation) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *EmployeeCompensation) GetJobID() *string { - if o == nil { - return nil - } - return o.JobID -} - -func (o *EmployeeCompensation) GetRate() *float64 { - if o == nil { - return nil - } - return o.Rate -} - -func (o *EmployeeCompensation) GetPaymentUnit() *PaymentUnit { - if o == nil { - return nil - } - return o.PaymentUnit -} - -func (o *EmployeeCompensation) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *EmployeeCompensation) GetFlsaStatus() *FlsaStatus { - if o == nil { - return nil - } - return o.FlsaStatus -} - -func (o *EmployeeCompensation) GetEffectiveDate() *string { - if o == nil { - return nil - } - return o.EffectiveDate -} - -func (o *EmployeeCompensation) GetPaymentFrequency() *PaymentFrequency { - if o == nil { - return nil - } - return o.PaymentFrequency -} - -type EmployeeCompensationInput struct { - // The amount paid per payment unit. - Rate *float64 `json:"rate,omitempty"` - // Unit of measurement for employee compensation. - PaymentUnit *PaymentUnit `json:"payment_unit,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 FLSA status for this compensation. - FlsaStatus *FlsaStatus `json:"flsa_status,omitempty"` - // The date on which a change to an employee's compensation takes effect. - EffectiveDate *string `json:"effective_date,omitempty"` - // Frequency of employee compensation. - PaymentFrequency *PaymentFrequency `json:"payment_frequency,omitempty"` -} - -func (o *EmployeeCompensationInput) GetRate() *float64 { - if o == nil { - return nil - } - return o.Rate -} - -func (o *EmployeeCompensationInput) GetPaymentUnit() *PaymentUnit { - if o == nil { - return nil - } - return o.PaymentUnit -} - -func (o *EmployeeCompensationInput) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *EmployeeCompensationInput) GetFlsaStatus() *FlsaStatus { - if o == nil { - return nil - } - return o.FlsaStatus -} - -func (o *EmployeeCompensationInput) GetEffectiveDate() *string { - if o == nil { - return nil - } - return o.EffectiveDate -} - -func (o *EmployeeCompensationInput) GetPaymentFrequency() *PaymentFrequency { - if o == nil { - return nil - } - return o.PaymentFrequency -} diff --git a/tests/mockserver/internal/sdk/models/components/employeejob.go b/tests/mockserver/internal/sdk/models/components/employeejob.go deleted file mode 100644 index 7e541c8c..00000000 --- a/tests/mockserver/internal/sdk/models/components/employeejob.go +++ /dev/null @@ -1,300 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/types" - "mockserver/internal/sdk/utils" -) - -// EmployeeJobStatus - Indicates the status of the job. -type EmployeeJobStatus string - -const ( - EmployeeJobStatusActive EmployeeJobStatus = "active" - EmployeeJobStatusInactive EmployeeJobStatus = "inactive" - EmployeeJobStatusOther EmployeeJobStatus = "other" -) - -func (e EmployeeJobStatus) ToPointer() *EmployeeJobStatus { - return &e -} -func (e *EmployeeJobStatus) 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 "other": - *e = EmployeeJobStatus(v) - return nil - default: - return fmt.Errorf("invalid value for EmployeeJobStatus: %v", v) - } -} - -type EmployeeJob struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // A unique identifier for an object. - EmployeeID *string `json:"employee_id,omitempty"` - // The job title of the person. - Title *string `json:"title,omitempty"` - // The position and responsibilities of the person within the organization. - Role *string `json:"role,omitempty"` - // The date on which the employee starts working in their current job role. - StartDate *types.Date `json:"start_date,omitempty"` - // The date on which the employee leaves or is expected to leave their current job role. - EndDate *types.Date `json:"end_date,omitempty"` - // The rate of pay for the employee in their current job role. - CompensationRate *float64 `json:"compensation_rate,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"` - // Unit of measurement for employee compensation. - PaymentUnit *PaymentUnit `json:"payment_unit,omitempty"` - // The date on which the employee was hired by the organization - HiredAt *types.Date `json:"hired_at,omitempty"` - // Indicates whether this the employee's primary job. - IsPrimary *bool `json:"is_primary,omitempty"` - // Indicates whether this the employee has a manager role. - IsManager *bool `json:"is_manager,omitempty"` - // Indicates the status of the job. - Status *EmployeeJobStatus `json:"status,omitempty"` - Location *Address `json:"location,omitempty"` -} - -func (e EmployeeJob) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(e, "", false) -} - -func (e *EmployeeJob) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { - return err - } - return nil -} - -func (o *EmployeeJob) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *EmployeeJob) GetEmployeeID() *string { - if o == nil { - return nil - } - return o.EmployeeID -} - -func (o *EmployeeJob) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *EmployeeJob) GetRole() *string { - if o == nil { - return nil - } - return o.Role -} - -func (o *EmployeeJob) GetStartDate() *types.Date { - if o == nil { - return nil - } - return o.StartDate -} - -func (o *EmployeeJob) GetEndDate() *types.Date { - if o == nil { - return nil - } - return o.EndDate -} - -func (o *EmployeeJob) GetCompensationRate() *float64 { - if o == nil { - return nil - } - return o.CompensationRate -} - -func (o *EmployeeJob) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *EmployeeJob) GetPaymentUnit() *PaymentUnit { - if o == nil { - return nil - } - return o.PaymentUnit -} - -func (o *EmployeeJob) GetHiredAt() *types.Date { - if o == nil { - return nil - } - return o.HiredAt -} - -func (o *EmployeeJob) GetIsPrimary() *bool { - if o == nil { - return nil - } - return o.IsPrimary -} - -func (o *EmployeeJob) GetIsManager() *bool { - if o == nil { - return nil - } - return o.IsManager -} - -func (o *EmployeeJob) GetStatus() *EmployeeJobStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *EmployeeJob) GetLocation() *Address { - if o == nil { - return nil - } - return o.Location -} - -type EmployeeJobInput struct { - // The job title of the person. - Title *string `json:"title,omitempty"` - // The position and responsibilities of the person within the organization. - Role *string `json:"role,omitempty"` - // The date on which the employee starts working in their current job role. - StartDate *types.Date `json:"start_date,omitempty"` - // The date on which the employee leaves or is expected to leave their current job role. - EndDate *types.Date `json:"end_date,omitempty"` - // The rate of pay for the employee in their current job role. - CompensationRate *float64 `json:"compensation_rate,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"` - // Unit of measurement for employee compensation. - PaymentUnit *PaymentUnit `json:"payment_unit,omitempty"` - // The date on which the employee was hired by the organization - HiredAt *types.Date `json:"hired_at,omitempty"` - // Indicates whether this the employee's primary job. - IsPrimary *bool `json:"is_primary,omitempty"` - // Indicates whether this the employee has a manager role. - IsManager *bool `json:"is_manager,omitempty"` - // Indicates the status of the job. - Status *EmployeeJobStatus `json:"status,omitempty"` - Location *Address `json:"location,omitempty"` -} - -func (e EmployeeJobInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(e, "", false) -} - -func (e *EmployeeJobInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { - return err - } - return nil -} - -func (o *EmployeeJobInput) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *EmployeeJobInput) GetRole() *string { - if o == nil { - return nil - } - return o.Role -} - -func (o *EmployeeJobInput) GetStartDate() *types.Date { - if o == nil { - return nil - } - return o.StartDate -} - -func (o *EmployeeJobInput) GetEndDate() *types.Date { - if o == nil { - return nil - } - return o.EndDate -} - -func (o *EmployeeJobInput) GetCompensationRate() *float64 { - if o == nil { - return nil - } - return o.CompensationRate -} - -func (o *EmployeeJobInput) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *EmployeeJobInput) GetPaymentUnit() *PaymentUnit { - if o == nil { - return nil - } - return o.PaymentUnit -} - -func (o *EmployeeJobInput) GetHiredAt() *types.Date { - if o == nil { - return nil - } - return o.HiredAt -} - -func (o *EmployeeJobInput) GetIsPrimary() *bool { - if o == nil { - return nil - } - return o.IsPrimary -} - -func (o *EmployeeJobInput) GetIsManager() *bool { - if o == nil { - return nil - } - return o.IsManager -} - -func (o *EmployeeJobInput) GetStatus() *EmployeeJobStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *EmployeeJobInput) GetLocation() *Address { - if o == nil { - return nil - } - return o.Location -} diff --git a/tests/mockserver/internal/sdk/models/components/employeepayroll.go b/tests/mockserver/internal/sdk/models/components/employeepayroll.go deleted file mode 100644 index 6b542508..00000000 --- a/tests/mockserver/internal/sdk/models/components/employeepayroll.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type EmployeePayroll struct { - // A unique identifier for an object. - ID *string `json:"id"` - // ID of the employee - EmployeeID *string `json:"employee_id,omitempty"` - // The unique identifier of the company. - CompanyID *string `json:"company_id,omitempty"` - // Whether or not the payroll has been successfully processed. Note that processed payrolls cannot be updated. - Processed *bool `json:"processed"` - // The date the payroll was processed. - ProcessedDate *string `json:"processed_date,omitempty"` - // The date on which employees will be paid for the payroll. - CheckDate *string `json:"check_date"` - // The start date, inclusive, of the pay period. - StartDate *string `json:"start_date"` - // The end date, inclusive, of the pay period. - EndDate *string `json:"end_date"` - // The overview of the payroll totals. - Totals *PayrollTotals `json:"totals,omitempty"` - // An array of compensations for the payroll. - Compensations []Compensation `json:"compensations,omitempty"` -} - -func (o *EmployeePayroll) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *EmployeePayroll) GetEmployeeID() *string { - if o == nil { - return nil - } - return o.EmployeeID -} - -func (o *EmployeePayroll) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *EmployeePayroll) GetProcessed() *bool { - if o == nil { - return nil - } - return o.Processed -} - -func (o *EmployeePayroll) GetProcessedDate() *string { - if o == nil { - return nil - } - return o.ProcessedDate -} - -func (o *EmployeePayroll) GetCheckDate() *string { - if o == nil { - return nil - } - return o.CheckDate -} - -func (o *EmployeePayroll) GetStartDate() *string { - if o == nil { - return nil - } - return o.StartDate -} - -func (o *EmployeePayroll) GetEndDate() *string { - if o == nil { - return nil - } - return o.EndDate -} - -func (o *EmployeePayroll) GetTotals() *PayrollTotals { - if o == nil { - return nil - } - return o.Totals -} - -func (o *EmployeePayroll) GetCompensations() []Compensation { - if o == nil { - return nil - } - return o.Compensations -} diff --git a/tests/mockserver/internal/sdk/models/components/employeeschedules.go b/tests/mockserver/internal/sdk/models/components/employeeschedules.go deleted file mode 100644 index 53d6e1a5..00000000 --- a/tests/mockserver/internal/sdk/models/components/employeeschedules.go +++ /dev/null @@ -1,22 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type EmployeeSchedules struct { - Employee *Employee `json:"employee,omitempty"` - Schedules []Schedule `json:"schedules,omitempty"` -} - -func (o *EmployeeSchedules) GetEmployee() *Employee { - if o == nil { - return nil - } - return o.Employee -} - -func (o *EmployeeSchedules) GetSchedules() []Schedule { - if o == nil { - return nil - } - return o.Schedules -} diff --git a/tests/mockserver/internal/sdk/models/components/employeesfilter.go b/tests/mockserver/internal/sdk/models/components/employeesfilter.go deleted file mode 100644 index 84d6ce2d..00000000 --- a/tests/mockserver/internal/sdk/models/components/employeesfilter.go +++ /dev/null @@ -1,143 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// EmployeesFilterEmploymentStatus - Employment status to filter on -type EmployeesFilterEmploymentStatus string - -const ( - EmployeesFilterEmploymentStatusActive EmployeesFilterEmploymentStatus = "active" - EmployeesFilterEmploymentStatusInactive EmployeesFilterEmploymentStatus = "inactive" - EmployeesFilterEmploymentStatusTerminated EmployeesFilterEmploymentStatus = "terminated" - EmployeesFilterEmploymentStatusOther EmployeesFilterEmploymentStatus = "other" -) - -func (e EmployeesFilterEmploymentStatus) ToPointer() *EmployeesFilterEmploymentStatus { - return &e -} -func (e *EmployeesFilterEmploymentStatus) 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 "terminated": - fallthrough - case "other": - *e = EmployeesFilterEmploymentStatus(v) - return nil - default: - return fmt.Errorf("invalid value for EmployeesFilterEmploymentStatus: %v", v) - } -} - -type EmployeesFilter struct { - // Company ID to filter on - CompanyID *string `queryParam:"name=company_id"` - // Email to filter on - Email *string `queryParam:"name=email"` - // First Name to filter on - FirstName *string `queryParam:"name=first_name"` - // Job title to filter on - Title *string `queryParam:"name=title"` - // Last Name to filter on - LastName *string `queryParam:"name=last_name"` - // Manager id to filter on - ManagerID *string `queryParam:"name=manager_id"` - // Employment status to filter on - EmploymentStatus *EmployeesFilterEmploymentStatus `queryParam:"name=employment_status"` - // Employee number to filter on - EmployeeNumber *string `queryParam:"name=employee_number"` - // ID of the department to filter on - DepartmentID *string `queryParam:"name=department_id"` - // City to filter on - City *string `queryParam:"name=city"` - // Country to filter on - Country *string `queryParam:"name=country"` -} - -func (o *EmployeesFilter) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *EmployeesFilter) GetEmail() *string { - if o == nil { - return nil - } - return o.Email -} - -func (o *EmployeesFilter) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *EmployeesFilter) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *EmployeesFilter) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *EmployeesFilter) GetManagerID() *string { - if o == nil { - return nil - } - return o.ManagerID -} - -func (o *EmployeesFilter) GetEmploymentStatus() *EmployeesFilterEmploymentStatus { - if o == nil { - return nil - } - return o.EmploymentStatus -} - -func (o *EmployeesFilter) GetEmployeeNumber() *string { - if o == nil { - return nil - } - return o.EmployeeNumber -} - -func (o *EmployeesFilter) GetDepartmentID() *string { - if o == nil { - return nil - } - return o.DepartmentID -} - -func (o *EmployeesFilter) GetCity() *string { - if o == nil { - return nil - } - return o.City -} - -func (o *EmployeesFilter) GetCountry() *string { - if o == nil { - return nil - } - return o.Country -} diff --git a/tests/mockserver/internal/sdk/models/components/employeesonefilter.go b/tests/mockserver/internal/sdk/models/components/employeesonefilter.go deleted file mode 100644 index 3fe7c051..00000000 --- a/tests/mockserver/internal/sdk/models/components/employeesonefilter.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type EmployeesOneFilter struct { - // Company ID to filter on - CompanyID *string `queryParam:"name=company_id"` -} - -func (o *EmployeesOneFilter) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} diff --git a/tests/mockserver/internal/sdk/models/components/employeessort.go b/tests/mockserver/internal/sdk/models/components/employeessort.go deleted file mode 100644 index dd0f921d..00000000 --- a/tests/mockserver/internal/sdk/models/components/employeessort.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// EmployeesSortBy - The field on which to sort the Employees -type EmployeesSortBy string - -const ( - EmployeesSortByFirstName EmployeesSortBy = "first_name" - EmployeesSortByLastName EmployeesSortBy = "last_name" - EmployeesSortByCreatedAt EmployeesSortBy = "created_at" - EmployeesSortByUpdatedAt EmployeesSortBy = "updated_at" -) - -func (e EmployeesSortBy) ToPointer() *EmployeesSortBy { - return &e -} -func (e *EmployeesSortBy) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "first_name": - fallthrough - case "last_name": - fallthrough - case "created_at": - fallthrough - case "updated_at": - *e = EmployeesSortBy(v) - return nil - default: - return fmt.Errorf("invalid value for EmployeesSortBy: %v", v) - } -} - -type EmployeesSort struct { - // The field on which to sort the Employees - By *EmployeesSortBy `queryParam:"name=by"` - // The direction in which to sort the results - Direction *SortDirection `default:"asc" queryParam:"name=direction"` -} - -func (e EmployeesSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(e, "", false) -} - -func (e *EmployeesSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { - return err - } - return nil -} - -func (o *EmployeesSort) GetBy() *EmployeesSortBy { - if o == nil { - return nil - } - return o.By -} - -func (o *EmployeesSort) GetDirection() *SortDirection { - if o == nil { - return nil - } - return o.Direction -} diff --git a/tests/mockserver/internal/sdk/models/components/employmentstatus.go b/tests/mockserver/internal/sdk/models/components/employmentstatus.go deleted file mode 100644 index a3e4b10e..00000000 --- a/tests/mockserver/internal/sdk/models/components/employmentstatus.go +++ /dev/null @@ -1,41 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// EmploymentStatus - The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. -type EmploymentStatus string - -const ( - EmploymentStatusActive EmploymentStatus = "active" - EmploymentStatusInactive EmploymentStatus = "inactive" - EmploymentStatusTerminated EmploymentStatus = "terminated" - EmploymentStatusOther EmploymentStatus = "other" -) - -func (e EmploymentStatus) ToPointer() *EmploymentStatus { - return &e -} -func (e *EmploymentStatus) 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 "terminated": - fallthrough - case "other": - *e = EmploymentStatus(v) - return nil - default: - return fmt.Errorf("invalid value for EmploymentStatus: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/expense.go b/tests/mockserver/internal/sdk/models/components/expense.go deleted file mode 100644 index a9c9c1d2..00000000 --- a/tests/mockserver/internal/sdk/models/components/expense.go +++ /dev/null @@ -1,487 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// ExpensePaymentType - The type of payment for the expense. -type ExpensePaymentType string - -const ( - ExpensePaymentTypeCash ExpensePaymentType = "cash" - ExpensePaymentTypeCheck ExpensePaymentType = "check" - ExpensePaymentTypeCreditCard ExpensePaymentType = "credit_card" -) - -func (e ExpensePaymentType) ToPointer() *ExpensePaymentType { - return &e -} -func (e *ExpensePaymentType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "cash": - fallthrough - case "check": - fallthrough - case "credit_card": - *e = ExpensePaymentType(v) - return nil - default: - return fmt.Errorf("invalid value for ExpensePaymentType: %v", v) - } -} - -// ExpenseType - The type of expense. -type ExpenseType string - -const ( - ExpenseTypeExpense ExpenseType = "expense" - ExpenseTypeRefund ExpenseType = "refund" -) - -func (e ExpenseType) ToPointer() *ExpenseType { - return &e -} -func (e *ExpenseType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "expense": - fallthrough - case "refund": - *e = ExpenseType(v) - return nil - default: - return fmt.Errorf("invalid value for ExpenseType: %v", v) - } -} - -type Expense struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // Number. - Number *string `json:"number,omitempty"` - // The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD - TransactionDate *time.Time `json:"transaction_date"` - // The unique identifier for the ledger account that this expense should be credited to. - AccountID string `json:"account_id"` - // The ID of the customer this entity is linked to. Used for expenses that should be marked as billable to customers. - CustomerID *string `json:"customer_id,omitempty"` - // The ID of the supplier this entity is linked to. - SupplierID *string `json:"supplier_id,omitempty"` - // The company or subsidiary id the transaction belongs to - CompanyID *string `json:"company_id,omitempty"` - // The ID of the department - DepartmentID *string `json:"department_id,omitempty"` - // The type of payment for the expense. - PaymentType *ExpensePaymentType `json:"payment_type,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"` - // Currency Exchange Rate at the time entity was recorded/generated. - CurrencyRate *float64 `json:"currency_rate,omitempty"` - // The type of expense. - Type *ExpenseType `json:"type,omitempty"` - // The memo of the expense. - Memo *string `json:"memo,omitempty"` - TaxRate *LinkedTaxRate `json:"tax_rate,omitempty"` - // The total amount of the expense line item. - TotalAmount *float64 `json:"total_amount,omitempty"` - // Expense line items linked to this expense. - LineItems []ExpenseLineItem `json:"line_items"` - // Optional reference identifier for the transaction. - Reference *string `json:"reference,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 last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (e Expense) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(e, "", false) -} - -func (e *Expense) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Expense) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Expense) GetNumber() *string { - if o == nil { - return nil - } - return o.Number -} - -func (o *Expense) GetTransactionDate() *time.Time { - if o == nil { - return nil - } - return o.TransactionDate -} - -func (o *Expense) GetAccountID() string { - if o == nil { - return "" - } - return o.AccountID -} - -func (o *Expense) GetCustomerID() *string { - if o == nil { - return nil - } - return o.CustomerID -} - -func (o *Expense) GetSupplierID() *string { - if o == nil { - return nil - } - return o.SupplierID -} - -func (o *Expense) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *Expense) GetDepartmentID() *string { - if o == nil { - return nil - } - return o.DepartmentID -} - -func (o *Expense) GetPaymentType() *ExpensePaymentType { - if o == nil { - return nil - } - return o.PaymentType -} - -func (o *Expense) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *Expense) GetCurrencyRate() *float64 { - if o == nil { - return nil - } - return o.CurrencyRate -} - -func (o *Expense) GetType() *ExpenseType { - if o == nil { - return nil - } - return o.Type -} - -func (o *Expense) GetMemo() *string { - if o == nil { - return nil - } - return o.Memo -} - -func (o *Expense) GetTaxRate() *LinkedTaxRate { - if o == nil { - return nil - } - return o.TaxRate -} - -func (o *Expense) GetTotalAmount() *float64 { - if o == nil { - return nil - } - return o.TotalAmount -} - -func (o *Expense) GetLineItems() []ExpenseLineItem { - if o == nil { - return []ExpenseLineItem{} - } - return o.LineItems -} - -func (o *Expense) GetReference() *string { - if o == nil { - return nil - } - return o.Reference -} - -func (o *Expense) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *Expense) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Expense) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Expense) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Expense) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *Expense) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *Expense) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *Expense) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type ExpenseInput struct { - // Number. - Number *string `json:"number,omitempty"` - // The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD - TransactionDate *time.Time `json:"transaction_date"` - // The unique identifier for the ledger account that this expense should be credited to. - AccountID string `json:"account_id"` - // The ID of the customer this entity is linked to. Used for expenses that should be marked as billable to customers. - CustomerID *string `json:"customer_id,omitempty"` - // The ID of the supplier this entity is linked to. - SupplierID *string `json:"supplier_id,omitempty"` - // The company or subsidiary id the transaction belongs to - CompanyID *string `json:"company_id,omitempty"` - // The ID of the department - DepartmentID *string `json:"department_id,omitempty"` - // The type of payment for the expense. - PaymentType *ExpensePaymentType `json:"payment_type,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"` - // Currency Exchange Rate at the time entity was recorded/generated. - CurrencyRate *float64 `json:"currency_rate,omitempty"` - // The type of expense. - Type *ExpenseType `json:"type,omitempty"` - // The memo of the expense. - Memo *string `json:"memo,omitempty"` - TaxRate *LinkedTaxRateInput `json:"tax_rate,omitempty"` - // The total amount of the expense line item. - TotalAmount *float64 `json:"total_amount,omitempty"` - // Expense line items linked to this expense. - LineItems []ExpenseLineItemInput `json:"line_items"` - // Optional reference identifier for the transaction. - Reference *string `json:"reference,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (e ExpenseInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(e, "", false) -} - -func (e *ExpenseInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ExpenseInput) GetNumber() *string { - if o == nil { - return nil - } - return o.Number -} - -func (o *ExpenseInput) GetTransactionDate() *time.Time { - if o == nil { - return nil - } - return o.TransactionDate -} - -func (o *ExpenseInput) GetAccountID() string { - if o == nil { - return "" - } - return o.AccountID -} - -func (o *ExpenseInput) GetCustomerID() *string { - if o == nil { - return nil - } - return o.CustomerID -} - -func (o *ExpenseInput) GetSupplierID() *string { - if o == nil { - return nil - } - return o.SupplierID -} - -func (o *ExpenseInput) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *ExpenseInput) GetDepartmentID() *string { - if o == nil { - return nil - } - return o.DepartmentID -} - -func (o *ExpenseInput) GetPaymentType() *ExpensePaymentType { - if o == nil { - return nil - } - return o.PaymentType -} - -func (o *ExpenseInput) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *ExpenseInput) GetCurrencyRate() *float64 { - if o == nil { - return nil - } - return o.CurrencyRate -} - -func (o *ExpenseInput) GetType() *ExpenseType { - if o == nil { - return nil - } - return o.Type -} - -func (o *ExpenseInput) GetMemo() *string { - if o == nil { - return nil - } - return o.Memo -} - -func (o *ExpenseInput) GetTaxRate() *LinkedTaxRateInput { - if o == nil { - return nil - } - return o.TaxRate -} - -func (o *ExpenseInput) GetTotalAmount() *float64 { - if o == nil { - return nil - } - return o.TotalAmount -} - -func (o *ExpenseInput) GetLineItems() []ExpenseLineItemInput { - if o == nil { - return []ExpenseLineItemInput{} - } - return o.LineItems -} - -func (o *ExpenseInput) GetReference() *string { - if o == nil { - return nil - } - return o.Reference -} - -func (o *ExpenseInput) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *ExpenseInput) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *ExpenseInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/expenselineitem.go b/tests/mockserver/internal/sdk/models/components/expenselineitem.go deleted file mode 100644 index 69711005..00000000 --- a/tests/mockserver/internal/sdk/models/components/expenselineitem.go +++ /dev/null @@ -1,113 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type ExpenseLineItem struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - // The unique identifier for the ledger account. - AccountID *string `json:"account_id,omitempty"` - // The ID of the customer this expense item is linked to. - CustomerID *string `json:"customer_id,omitempty"` - // The ID of the department - DepartmentID *string `json:"department_id,omitempty"` - // The ID of the location - LocationID *string `json:"location_id,omitempty"` - // The ID of the subsidiary - SubsidiaryID *string `json:"subsidiary_id,omitempty"` - TaxRate *LinkedTaxRate `json:"tax_rate,omitempty"` - // The expense line item description - Description *string `json:"description,omitempty"` - // The total amount of the expense line item. - TotalAmount *float64 `json:"total_amount"` - // Boolean that indicates if the line item is billable or not. - Billable *bool `json:"billable,omitempty"` - // Line number of the resource - LineNumber *int64 `json:"line_number,omitempty"` -} - -func (o *ExpenseLineItem) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *ExpenseLineItem) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *ExpenseLineItem) GetAccountID() *string { - if o == nil { - return nil - } - return o.AccountID -} - -func (o *ExpenseLineItem) GetCustomerID() *string { - if o == nil { - return nil - } - return o.CustomerID -} - -func (o *ExpenseLineItem) GetDepartmentID() *string { - if o == nil { - return nil - } - return o.DepartmentID -} - -func (o *ExpenseLineItem) GetLocationID() *string { - if o == nil { - return nil - } - return o.LocationID -} - -func (o *ExpenseLineItem) GetSubsidiaryID() *string { - if o == nil { - return nil - } - return o.SubsidiaryID -} - -func (o *ExpenseLineItem) GetTaxRate() *LinkedTaxRate { - if o == nil { - return nil - } - return o.TaxRate -} - -func (o *ExpenseLineItem) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *ExpenseLineItem) GetTotalAmount() *float64 { - if o == nil { - return nil - } - return o.TotalAmount -} - -func (o *ExpenseLineItem) GetBillable() *bool { - if o == nil { - return nil - } - return o.Billable -} - -func (o *ExpenseLineItem) GetLineNumber() *int64 { - if o == nil { - return nil - } - return o.LineNumber -} diff --git a/tests/mockserver/internal/sdk/models/components/expenselineiteminput.go b/tests/mockserver/internal/sdk/models/components/expenselineiteminput.go deleted file mode 100644 index 49a6c443..00000000 --- a/tests/mockserver/internal/sdk/models/components/expenselineiteminput.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type ExpenseLineItemInput struct { - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - // The unique identifier for the ledger account. - AccountID *string `json:"account_id,omitempty"` - // The ID of the customer this expense item is linked to. - CustomerID *string `json:"customer_id,omitempty"` - // The ID of the department - DepartmentID *string `json:"department_id,omitempty"` - // The ID of the location - LocationID *string `json:"location_id,omitempty"` - // The ID of the subsidiary - SubsidiaryID *string `json:"subsidiary_id,omitempty"` - TaxRate *LinkedTaxRateInput `json:"tax_rate,omitempty"` - // The expense line item description - Description *string `json:"description,omitempty"` - // The total amount of the expense line item. - TotalAmount *float64 `json:"total_amount"` - // Boolean that indicates if the line item is billable or not. - Billable *bool `json:"billable,omitempty"` - // Line number of the resource - LineNumber *int64 `json:"line_number,omitempty"` -} - -func (o *ExpenseLineItemInput) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *ExpenseLineItemInput) GetAccountID() *string { - if o == nil { - return nil - } - return o.AccountID -} - -func (o *ExpenseLineItemInput) GetCustomerID() *string { - if o == nil { - return nil - } - return o.CustomerID -} - -func (o *ExpenseLineItemInput) GetDepartmentID() *string { - if o == nil { - return nil - } - return o.DepartmentID -} - -func (o *ExpenseLineItemInput) GetLocationID() *string { - if o == nil { - return nil - } - return o.LocationID -} - -func (o *ExpenseLineItemInput) GetSubsidiaryID() *string { - if o == nil { - return nil - } - return o.SubsidiaryID -} - -func (o *ExpenseLineItemInput) GetTaxRate() *LinkedTaxRateInput { - if o == nil { - return nil - } - return o.TaxRate -} - -func (o *ExpenseLineItemInput) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *ExpenseLineItemInput) GetTotalAmount() *float64 { - if o == nil { - return nil - } - return o.TotalAmount -} - -func (o *ExpenseLineItemInput) GetBillable() *bool { - if o == nil { - return nil - } - return o.Billable -} - -func (o *ExpenseLineItemInput) GetLineNumber() *int64 { - if o == nil { - return nil - } - return o.LineNumber -} diff --git a/tests/mockserver/internal/sdk/models/components/filesfilter.go b/tests/mockserver/internal/sdk/models/components/filesfilter.go deleted file mode 100644 index 616f6ede..00000000 --- a/tests/mockserver/internal/sdk/models/components/filesfilter.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type FilesFilter struct { - // ID of the drive to filter on - DriveID *string `queryParam:"name=drive_id"` - // ID of the folder to filter on. The root folder has an alias "root" - FolderID *string `queryParam:"name=folder_id"` - // Only return files and folders that are shared - Shared *bool `queryParam:"name=shared"` -} - -func (o *FilesFilter) GetDriveID() *string { - if o == nil { - return nil - } - return o.DriveID -} - -func (o *FilesFilter) GetFolderID() *string { - if o == nil { - return nil - } - return o.FolderID -} - -func (o *FilesFilter) GetShared() *bool { - if o == nil { - return nil - } - return o.Shared -} diff --git a/tests/mockserver/internal/sdk/models/components/filessearch.go b/tests/mockserver/internal/sdk/models/components/filessearch.go deleted file mode 100644 index 27d082d3..00000000 --- a/tests/mockserver/internal/sdk/models/components/filessearch.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type FilesSearch struct { - // The query to search for. May match across multiple fields. - Query string `json:"query"` - // ID of the drive to filter on - DriveID *string `json:"drive_id,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *FilesSearch) GetQuery() string { - if o == nil { - return "" - } - return o.Query -} - -func (o *FilesSearch) GetDriveID() *string { - if o == nil { - return nil - } - return o.DriveID -} - -func (o *FilesSearch) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/filessort.go b/tests/mockserver/internal/sdk/models/components/filessort.go deleted file mode 100644 index 2807b747..00000000 --- a/tests/mockserver/internal/sdk/models/components/filessort.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// FilesSortBy - The field on which to sort the Files -type FilesSortBy string - -const ( - FilesSortByUpdatedAt FilesSortBy = "updated_at" - FilesSortByName FilesSortBy = "name" -) - -func (e FilesSortBy) ToPointer() *FilesSortBy { - return &e -} -func (e *FilesSortBy) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "updated_at": - fallthrough - case "name": - *e = FilesSortBy(v) - return nil - default: - return fmt.Errorf("invalid value for FilesSortBy: %v", v) - } -} - -type FilesSort struct { - // The field on which to sort the Files - By *FilesSortBy `queryParam:"name=by"` - // The direction in which to sort the results - Direction *SortDirection `default:"asc" queryParam:"name=direction"` -} - -func (f FilesSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FilesSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FilesSort) GetBy() *FilesSortBy { - if o == nil { - return nil - } - return o.By -} - -func (o *FilesSort) GetDirection() *SortDirection { - if o == nil { - return nil - } - return o.Direction -} diff --git a/tests/mockserver/internal/sdk/models/components/filetype.go b/tests/mockserver/internal/sdk/models/components/filetype.go deleted file mode 100644 index bb40f783..00000000 --- a/tests/mockserver/internal/sdk/models/components/filetype.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// FileType - The type of resource. Could be file, folder or url -type FileType string - -const ( - FileTypeFile FileType = "file" - FileTypeFolder FileType = "folder" - FileTypeURL FileType = "url" -) - -func (e FileType) ToPointer() *FileType { - return &e -} -func (e *FileType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "file": - fallthrough - case "folder": - fallthrough - case "url": - *e = FileType(v) - return nil - default: - return fmt.Errorf("invalid value for FileType: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/folder.go b/tests/mockserver/internal/sdk/models/components/folder.go deleted file mode 100644 index 885dd7bf..00000000 --- a/tests/mockserver/internal/sdk/models/components/folder.go +++ /dev/null @@ -1,138 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type Folder struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The name of the folder - Name string `json:"name"` - // Optional description of the folder - Description *string `json:"description,omitempty"` - // The full path of the folder (includes the folder name) - Path *string `json:"path,omitempty"` - // The size of the folder in bytes - Size *int64 `json:"size,omitempty"` - Owner *Owner `json:"owner,omitempty"` - // The parent folders of the file, starting from the root - ParentFolders []LinkedFolder `json:"parent_folders"` - // Whether the list of parent folder is complete. Some connectors only return the direct parent of a folder - ParentFoldersComplete *bool `json:"parent_folders_complete,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` -} - -func (f Folder) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *Folder) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Folder) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Folder) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *Folder) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *Folder) GetPath() *string { - if o == nil { - return nil - } - return o.Path -} - -func (o *Folder) GetSize() *int64 { - if o == nil { - return nil - } - return o.Size -} - -func (o *Folder) GetOwner() *Owner { - if o == nil { - return nil - } - return o.Owner -} - -func (o *Folder) GetParentFolders() []LinkedFolder { - if o == nil { - return []LinkedFolder{} - } - return o.ParentFolders -} - -func (o *Folder) GetParentFoldersComplete() *bool { - if o == nil { - return nil - } - return o.ParentFoldersComplete -} - -func (o *Folder) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Folder) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *Folder) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *Folder) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Folder) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} diff --git a/tests/mockserver/internal/sdk/models/components/formfield.go b/tests/mockserver/internal/sdk/models/components/formfield.go deleted file mode 100644 index f84f7349..00000000 --- a/tests/mockserver/internal/sdk/models/components/formfield.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -type FormFieldType string - -const ( - FormFieldTypeText FormFieldType = "text" - FormFieldTypeCheckbox FormFieldType = "checkbox" - FormFieldTypeTel FormFieldType = "tel" - FormFieldTypeEmail FormFieldType = "email" - FormFieldTypeURL FormFieldType = "url" - FormFieldTypeTextarea FormFieldType = "textarea" - FormFieldTypeSelect FormFieldType = "select" - FormFieldTypeFilteredSelect FormFieldType = "filtered-select" - FormFieldTypeMultiSelect FormFieldType = "multi-select" - FormFieldTypeDatetime FormFieldType = "datetime" - FormFieldTypeDate FormFieldType = "date" - FormFieldTypeTime FormFieldType = "time" - FormFieldTypeNumber FormFieldType = "number" -) - -func (e FormFieldType) ToPointer() *FormFieldType { - return &e -} -func (e *FormFieldType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "text": - fallthrough - case "checkbox": - fallthrough - case "tel": - fallthrough - case "email": - fallthrough - case "url": - fallthrough - case "textarea": - fallthrough - case "select": - fallthrough - case "filtered-select": - fallthrough - case "multi-select": - fallthrough - case "datetime": - fallthrough - case "date": - fallthrough - case "time": - fallthrough - case "number": - *e = FormFieldType(v) - return nil - default: - return fmt.Errorf("invalid value for FormFieldType: %v", v) - } -} - -type FormField struct { - // The unique identifier of the form field. - ID *string `json:"id,omitempty"` - // The label of the field - Label *string `json:"label,omitempty"` - // The placeholder for the form field - Placeholder *string `json:"placeholder,omitempty"` - // The description of the form field - Description *string `json:"description,omitempty"` - Type *FormFieldType `json:"type,omitempty"` - // Indicates if the form field is required, which means it must be filled in before the form can be submitted - Required *bool `json:"required,omitempty"` - CustomField *bool `json:"custom_field,omitempty"` - // Only applicable to select fields. Allow the user to add a custom value though the option select if the desired value is not in the option select list. - AllowCustomValues *bool `default:"false" json:"allow_custom_values"` - // Indicates if the form field is displayed in a “read-only” mode. - Disabled *bool `json:"disabled,omitempty"` - // Indicates if the form field is not displayed but the value that is being stored on the connection. - Hidden *bool `json:"hidden,omitempty"` - // When the setting is deprecated, it should be hidden from the user interface. The value will still be stored on the connection for the sake of backwards compatibility. - Deprecated *bool `json:"deprecated,omitempty"` - // Indicates if the form field contains sensitive data, which will display the value as a masked input. - Sensitive *bool `json:"sensitive,omitempty"` - // Prefix to display in front of the form field. - Prefix *string `json:"prefix,omitempty"` - // Suffix to display next to the form field. - Suffix *string `json:"suffix,omitempty"` - Options []FormFieldOption `json:"options,omitempty"` -} - -func (f FormField) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FormField) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FormField) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *FormField) GetLabel() *string { - if o == nil { - return nil - } - return o.Label -} - -func (o *FormField) GetPlaceholder() *string { - if o == nil { - return nil - } - return o.Placeholder -} - -func (o *FormField) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *FormField) GetType() *FormFieldType { - if o == nil { - return nil - } - return o.Type -} - -func (o *FormField) GetRequired() *bool { - if o == nil { - return nil - } - return o.Required -} - -func (o *FormField) GetCustomField() *bool { - if o == nil { - return nil - } - return o.CustomField -} - -func (o *FormField) GetAllowCustomValues() *bool { - if o == nil { - return nil - } - return o.AllowCustomValues -} - -func (o *FormField) GetDisabled() *bool { - if o == nil { - return nil - } - return o.Disabled -} - -func (o *FormField) GetHidden() *bool { - if o == nil { - return nil - } - return o.Hidden -} - -func (o *FormField) GetDeprecated() *bool { - if o == nil { - return nil - } - return o.Deprecated -} - -func (o *FormField) GetSensitive() *bool { - if o == nil { - return nil - } - return o.Sensitive -} - -func (o *FormField) GetPrefix() *string { - if o == nil { - return nil - } - return o.Prefix -} - -func (o *FormField) GetSuffix() *string { - if o == nil { - return nil - } - return o.Suffix -} - -func (o *FormField) GetOptions() []FormFieldOption { - if o == nil { - return nil - } - return o.Options -} diff --git a/tests/mockserver/internal/sdk/models/components/formfieldoption.go b/tests/mockserver/internal/sdk/models/components/formfieldoption.go deleted file mode 100644 index 7013119b..00000000 --- a/tests/mockserver/internal/sdk/models/components/formfieldoption.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "errors" - "fmt" - "mockserver/internal/sdk/utils" -) - -type FormFieldOptionType string - -const ( - FormFieldOptionTypeSimple FormFieldOptionType = "simple" - FormFieldOptionTypeGroup FormFieldOptionType = "group" -) - -type FormFieldOption struct { - SimpleFormFieldOption *SimpleFormFieldOption `queryParam:"inline"` - FormFieldOptionGroup *FormFieldOptionGroup `queryParam:"inline"` - - Type FormFieldOptionType -} - -func CreateFormFieldOptionSimple(simple SimpleFormFieldOption) FormFieldOption { - typ := FormFieldOptionTypeSimple - - typStr := SimpleFormFieldOptionOptionType(typ) - simple.OptionType = typStr - - return FormFieldOption{ - SimpleFormFieldOption: &simple, - Type: typ, - } -} - -func CreateFormFieldOptionGroup(group FormFieldOptionGroup) FormFieldOption { - typ := FormFieldOptionTypeGroup - - typStr := FormFieldOptionGroupOptionType(typ) - group.OptionType = typStr - - return FormFieldOption{ - FormFieldOptionGroup: &group, - Type: typ, - } -} - -func (u *FormFieldOption) UnmarshalJSON(data []byte) error { - - type discriminator struct { - OptionType string `json:"option_type"` - } - - dis := new(discriminator) - if err := json.Unmarshal(data, &dis); err != nil { - return fmt.Errorf("could not unmarshal discriminator: %w", err) - } - - switch dis.OptionType { - case "simple": - simpleFormFieldOption := new(SimpleFormFieldOption) - if err := utils.UnmarshalJSON(data, &simpleFormFieldOption, "", true, false); err != nil { - return fmt.Errorf("could not unmarshal `%s` into expected (OptionType == simple) type SimpleFormFieldOption within FormFieldOption: %w", string(data), err) - } - - u.SimpleFormFieldOption = simpleFormFieldOption - u.Type = FormFieldOptionTypeSimple - return nil - case "group": - formFieldOptionGroup := new(FormFieldOptionGroup) - if err := utils.UnmarshalJSON(data, &formFieldOptionGroup, "", true, false); err != nil { - return fmt.Errorf("could not unmarshal `%s` into expected (OptionType == group) type FormFieldOptionGroup within FormFieldOption: %w", string(data), err) - } - - u.FormFieldOptionGroup = formFieldOptionGroup - u.Type = FormFieldOptionTypeGroup - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for FormFieldOption", string(data)) -} - -func (u FormFieldOption) MarshalJSON() ([]byte, error) { - if u.SimpleFormFieldOption != nil { - return utils.MarshalJSON(u.SimpleFormFieldOption, "", true) - } - - if u.FormFieldOptionGroup != nil { - return utils.MarshalJSON(u.FormFieldOptionGroup, "", true) - } - - return nil, errors.New("could not marshal union type FormFieldOption: all fields are null") -} diff --git a/tests/mockserver/internal/sdk/models/components/formfieldoptiongroup.go b/tests/mockserver/internal/sdk/models/components/formfieldoptiongroup.go deleted file mode 100644 index 99fc5a85..00000000 --- a/tests/mockserver/internal/sdk/models/components/formfieldoptiongroup.go +++ /dev/null @@ -1,66 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -type FormFieldOptionGroupOptionType string - -const ( - FormFieldOptionGroupOptionTypeGroup FormFieldOptionGroupOptionType = "group" -) - -func (e FormFieldOptionGroupOptionType) ToPointer() *FormFieldOptionGroupOptionType { - return &e -} -func (e *FormFieldOptionGroupOptionType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "group": - *e = FormFieldOptionGroupOptionType(v) - return nil - default: - return fmt.Errorf("invalid value for FormFieldOptionGroupOptionType: %v", v) - } -} - -type FormFieldOptionGroup struct { - ID *string `json:"id,omitempty"` - Label string `json:"label"` - Options []SimpleFormFieldOption `json:"options"` - OptionType FormFieldOptionGroupOptionType `json:"option_type"` -} - -func (o *FormFieldOptionGroup) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *FormFieldOptionGroup) GetLabel() string { - if o == nil { - return "" - } - return o.Label -} - -func (o *FormFieldOptionGroup) GetOptions() []SimpleFormFieldOption { - if o == nil { - return []SimpleFormFieldOption{} - } - return o.Options -} - -func (o *FormFieldOptionGroup) GetOptionType() FormFieldOptionGroupOptionType { - if o == nil { - return FormFieldOptionGroupOptionType("") - } - return o.OptionType -} diff --git a/tests/mockserver/internal/sdk/models/components/gender.go b/tests/mockserver/internal/sdk/models/components/gender.go deleted file mode 100644 index 239a3f56..00000000 --- a/tests/mockserver/internal/sdk/models/components/gender.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// Gender - The gender represents the gender identity of a person. -type Gender string - -const ( - GenderMale Gender = "male" - GenderFemale Gender = "female" - GenderUnisex Gender = "unisex" - GenderOther Gender = "other" - GenderNotSpecified Gender = "not_specified" -) - -func (e Gender) ToPointer() *Gender { - return &e -} -func (e *Gender) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "male": - fallthrough - case "female": - fallthrough - case "unisex": - fallthrough - case "other": - fallthrough - case "not_specified": - *e = Gender(v) - return nil - default: - return fmt.Errorf("invalid value for Gender: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/getaccountingdepartmentresponse.go b/tests/mockserver/internal/sdk/models/components/getaccountingdepartmentresponse.go deleted file mode 100644 index dc36537e..00000000 --- a/tests/mockserver/internal/sdk/models/components/getaccountingdepartmentresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetAccountingDepartmentResponse - Location -type GetAccountingDepartmentResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data AccountingDepartment `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetAccountingDepartmentResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetAccountingDepartmentResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetAccountingDepartmentResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetAccountingDepartmentResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetAccountingDepartmentResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetAccountingDepartmentResponse) GetData() AccountingDepartment { - if o == nil { - return AccountingDepartment{} - } - return o.Data -} - -func (o *GetAccountingDepartmentResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getaccountingdepartmentsresponse.go b/tests/mockserver/internal/sdk/models/components/getaccountingdepartmentsresponse.go deleted file mode 100644 index ff2b87b1..00000000 --- a/tests/mockserver/internal/sdk/models/components/getaccountingdepartmentsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetAccountingDepartmentsResponse - Departments -type GetAccountingDepartmentsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []AccountingDepartment `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetAccountingDepartmentsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetAccountingDepartmentsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetAccountingDepartmentsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetAccountingDepartmentsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetAccountingDepartmentsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetAccountingDepartmentsResponse) GetData() []AccountingDepartment { - if o == nil { - return []AccountingDepartment{} - } - return o.Data -} - -func (o *GetAccountingDepartmentsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetAccountingDepartmentsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetAccountingDepartmentsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getaccountinglocationresponse.go b/tests/mockserver/internal/sdk/models/components/getaccountinglocationresponse.go deleted file mode 100644 index c078dcb4..00000000 --- a/tests/mockserver/internal/sdk/models/components/getaccountinglocationresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetAccountingLocationResponse - Location -type GetAccountingLocationResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data AccountingLocation `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetAccountingLocationResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetAccountingLocationResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetAccountingLocationResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetAccountingLocationResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetAccountingLocationResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetAccountingLocationResponse) GetData() AccountingLocation { - if o == nil { - return AccountingLocation{} - } - return o.Data -} - -func (o *GetAccountingLocationResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getaccountinglocationsresponse.go b/tests/mockserver/internal/sdk/models/components/getaccountinglocationsresponse.go deleted file mode 100644 index ac927bb8..00000000 --- a/tests/mockserver/internal/sdk/models/components/getaccountinglocationsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetAccountingLocationsResponse - Locations -type GetAccountingLocationsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []AccountingLocation `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetAccountingLocationsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetAccountingLocationsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetAccountingLocationsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetAccountingLocationsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetAccountingLocationsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetAccountingLocationsResponse) GetData() []AccountingLocation { - if o == nil { - return []AccountingLocation{} - } - return o.Data -} - -func (o *GetAccountingLocationsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetAccountingLocationsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetAccountingLocationsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getactivitiesresponse.go b/tests/mockserver/internal/sdk/models/components/getactivitiesresponse.go deleted file mode 100644 index a09fbc54..00000000 --- a/tests/mockserver/internal/sdk/models/components/getactivitiesresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetActivitiesResponse - Activities -type GetActivitiesResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Activity `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetActivitiesResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetActivitiesResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetActivitiesResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetActivitiesResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetActivitiesResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetActivitiesResponse) GetData() []Activity { - if o == nil { - return []Activity{} - } - return o.Data -} - -func (o *GetActivitiesResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetActivitiesResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetActivitiesResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getactivityresponse.go b/tests/mockserver/internal/sdk/models/components/getactivityresponse.go deleted file mode 100644 index 8d87fc61..00000000 --- a/tests/mockserver/internal/sdk/models/components/getactivityresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetActivityResponse - Activity -type GetActivityResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Activity `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetActivityResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetActivityResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetActivityResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetActivityResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetActivityResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetActivityResponse) GetData() Activity { - if o == nil { - return Activity{} - } - return o.Data -} - -func (o *GetActivityResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getagedcreditorsresponse.go b/tests/mockserver/internal/sdk/models/components/getagedcreditorsresponse.go deleted file mode 100644 index bbe2a5c8..00000000 --- a/tests/mockserver/internal/sdk/models/components/getagedcreditorsresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetAgedCreditorsResponse - Aged Creditors -type GetAgedCreditorsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data AgedCreditors `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetAgedCreditorsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetAgedCreditorsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetAgedCreditorsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetAgedCreditorsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetAgedCreditorsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetAgedCreditorsResponse) GetData() AgedCreditors { - if o == nil { - return AgedCreditors{} - } - return o.Data -} - -func (o *GetAgedCreditorsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getageddebtorsresponse.go b/tests/mockserver/internal/sdk/models/components/getageddebtorsresponse.go deleted file mode 100644 index 25ecb9b8..00000000 --- a/tests/mockserver/internal/sdk/models/components/getageddebtorsresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetAgedDebtorsResponse - Aged Debtors -type GetAgedDebtorsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data AgedDebtors `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetAgedDebtorsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetAgedDebtorsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetAgedDebtorsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetAgedDebtorsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetAgedDebtorsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetAgedDebtorsResponse) GetData() AgedDebtors { - if o == nil { - return AgedDebtors{} - } - return o.Data -} - -func (o *GetAgedDebtorsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getapiresourcecoverageresponse.go b/tests/mockserver/internal/sdk/models/components/getapiresourcecoverageresponse.go deleted file mode 100644 index f87418e5..00000000 --- a/tests/mockserver/internal/sdk/models/components/getapiresourcecoverageresponse.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetAPIResourceCoverageResponse - ApiResources -type GetAPIResourceCoverageResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data APIResourceCoverage `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetAPIResourceCoverageResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetAPIResourceCoverageResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetAPIResourceCoverageResponse) GetData() APIResourceCoverage { - if o == nil { - return APIResourceCoverage{} - } - return o.Data -} - -func (o *GetAPIResourceCoverageResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetAPIResourceCoverageResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetAPIResourceCoverageResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getapiresourceresponse.go b/tests/mockserver/internal/sdk/models/components/getapiresourceresponse.go deleted file mode 100644 index fd958b02..00000000 --- a/tests/mockserver/internal/sdk/models/components/getapiresourceresponse.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetAPIResourceResponse - ApiResources -type GetAPIResourceResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data APIResource `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetAPIResourceResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetAPIResourceResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetAPIResourceResponse) GetData() APIResource { - if o == nil { - return APIResource{} - } - return o.Data -} - -func (o *GetAPIResourceResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetAPIResourceResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetAPIResourceResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getapiresponse.go b/tests/mockserver/internal/sdk/models/components/getapiresponse.go deleted file mode 100644 index 494622b6..00000000 --- a/tests/mockserver/internal/sdk/models/components/getapiresponse.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetAPIResponse - Apis -type GetAPIResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data API `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetAPIResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetAPIResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetAPIResponse) GetData() API { - if o == nil { - return API{} - } - return o.Data -} - -func (o *GetAPIResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetAPIResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetAPIResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getapisresponse.go b/tests/mockserver/internal/sdk/models/components/getapisresponse.go deleted file mode 100644 index 8054846c..00000000 --- a/tests/mockserver/internal/sdk/models/components/getapisresponse.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetApisResponse - Apis -type GetApisResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data []API `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetApisResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetApisResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetApisResponse) GetData() []API { - if o == nil { - return []API{} - } - return o.Data -} - -func (o *GetApisResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetApisResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetApisResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getapplicantresponse.go b/tests/mockserver/internal/sdk/models/components/getapplicantresponse.go deleted file mode 100644 index 3674837f..00000000 --- a/tests/mockserver/internal/sdk/models/components/getapplicantresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetApplicantResponse - Applicants -type GetApplicantResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Applicant `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetApplicantResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetApplicantResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetApplicantResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetApplicantResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetApplicantResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetApplicantResponse) GetData() Applicant { - if o == nil { - return Applicant{} - } - return o.Data -} - -func (o *GetApplicantResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getapplicantsresponse.go b/tests/mockserver/internal/sdk/models/components/getapplicantsresponse.go deleted file mode 100644 index 2328a989..00000000 --- a/tests/mockserver/internal/sdk/models/components/getapplicantsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetApplicantsResponse - Applicants -type GetApplicantsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Applicant `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetApplicantsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetApplicantsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetApplicantsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetApplicantsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetApplicantsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetApplicantsResponse) GetData() []Applicant { - if o == nil { - return []Applicant{} - } - return o.Data -} - -func (o *GetApplicantsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetApplicantsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetApplicantsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getapplicationresponse.go b/tests/mockserver/internal/sdk/models/components/getapplicationresponse.go deleted file mode 100644 index 17c2f772..00000000 --- a/tests/mockserver/internal/sdk/models/components/getapplicationresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetApplicationResponse - Applications -type GetApplicationResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Application `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetApplicationResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetApplicationResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetApplicationResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetApplicationResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetApplicationResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetApplicationResponse) GetData() Application { - if o == nil { - return Application{} - } - return o.Data -} - -func (o *GetApplicationResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getapplicationsresponse.go b/tests/mockserver/internal/sdk/models/components/getapplicationsresponse.go deleted file mode 100644 index 806aa06f..00000000 --- a/tests/mockserver/internal/sdk/models/components/getapplicationsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetApplicationsResponse - Applications -type GetApplicationsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Application `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetApplicationsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetApplicationsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetApplicationsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetApplicationsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetApplicationsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetApplicationsResponse) GetData() []Application { - if o == nil { - return []Application{} - } - return o.Data -} - -func (o *GetApplicationsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetApplicationsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetApplicationsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getattachmentresponse.go b/tests/mockserver/internal/sdk/models/components/getattachmentresponse.go deleted file mode 100644 index 4bfa04dd..00000000 --- a/tests/mockserver/internal/sdk/models/components/getattachmentresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetAttachmentResponse - Attachments -type GetAttachmentResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Attachment `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetAttachmentResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetAttachmentResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetAttachmentResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetAttachmentResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetAttachmentResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetAttachmentResponse) GetData() Attachment { - if o == nil { - return Attachment{} - } - return o.Data -} - -func (o *GetAttachmentResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getattachmentsresponse.go b/tests/mockserver/internal/sdk/models/components/getattachmentsresponse.go deleted file mode 100644 index e9287cc9..00000000 --- a/tests/mockserver/internal/sdk/models/components/getattachmentsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetAttachmentsResponse - Attachments -type GetAttachmentsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Attachment `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetAttachmentsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetAttachmentsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetAttachmentsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetAttachmentsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetAttachmentsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetAttachmentsResponse) GetData() []Attachment { - if o == nil { - return []Attachment{} - } - return o.Data -} - -func (o *GetAttachmentsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetAttachmentsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetAttachmentsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getbalancesheetresponse.go b/tests/mockserver/internal/sdk/models/components/getbalancesheetresponse.go deleted file mode 100644 index 4eb1fde1..00000000 --- a/tests/mockserver/internal/sdk/models/components/getbalancesheetresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetBalanceSheetResponse - BalanceSheet -type GetBalanceSheetResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data BalanceSheet `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetBalanceSheetResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetBalanceSheetResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetBalanceSheetResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetBalanceSheetResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetBalanceSheetResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetBalanceSheetResponse) GetData() BalanceSheet { - if o == nil { - return BalanceSheet{} - } - return o.Data -} - -func (o *GetBalanceSheetResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getbankfeedaccountresponse.go b/tests/mockserver/internal/sdk/models/components/getbankfeedaccountresponse.go deleted file mode 100644 index 74c5a13c..00000000 --- a/tests/mockserver/internal/sdk/models/components/getbankfeedaccountresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetBankFeedAccountResponse - Bank Feed Accounts -type GetBankFeedAccountResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data BankFeedAccount `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetBankFeedAccountResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetBankFeedAccountResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetBankFeedAccountResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetBankFeedAccountResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetBankFeedAccountResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetBankFeedAccountResponse) GetData() BankFeedAccount { - if o == nil { - return BankFeedAccount{} - } - return o.Data -} - -func (o *GetBankFeedAccountResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getbankfeedaccountsresponse.go b/tests/mockserver/internal/sdk/models/components/getbankfeedaccountsresponse.go deleted file mode 100644 index 86456654..00000000 --- a/tests/mockserver/internal/sdk/models/components/getbankfeedaccountsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetBankFeedAccountsResponse - Bank Feed Accounts -type GetBankFeedAccountsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []BankFeedAccount `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetBankFeedAccountsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetBankFeedAccountsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetBankFeedAccountsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetBankFeedAccountsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetBankFeedAccountsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetBankFeedAccountsResponse) GetData() []BankFeedAccount { - if o == nil { - return []BankFeedAccount{} - } - return o.Data -} - -func (o *GetBankFeedAccountsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetBankFeedAccountsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetBankFeedAccountsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getbankfeedstatementresponse.go b/tests/mockserver/internal/sdk/models/components/getbankfeedstatementresponse.go deleted file mode 100644 index ef845eac..00000000 --- a/tests/mockserver/internal/sdk/models/components/getbankfeedstatementresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetBankFeedStatementResponse - Bank Feed Statements -type GetBankFeedStatementResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data BankFeedStatement `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetBankFeedStatementResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetBankFeedStatementResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetBankFeedStatementResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetBankFeedStatementResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetBankFeedStatementResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetBankFeedStatementResponse) GetData() BankFeedStatement { - if o == nil { - return BankFeedStatement{} - } - return o.Data -} - -func (o *GetBankFeedStatementResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getbankfeedstatementsresponse.go b/tests/mockserver/internal/sdk/models/components/getbankfeedstatementsresponse.go deleted file mode 100644 index f124c7a6..00000000 --- a/tests/mockserver/internal/sdk/models/components/getbankfeedstatementsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetBankFeedStatementsResponse - Bank Feed Statements -type GetBankFeedStatementsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []BankFeedStatement `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetBankFeedStatementsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetBankFeedStatementsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetBankFeedStatementsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetBankFeedStatementsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetBankFeedStatementsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetBankFeedStatementsResponse) GetData() []BankFeedStatement { - if o == nil { - return []BankFeedStatement{} - } - return o.Data -} - -func (o *GetBankFeedStatementsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetBankFeedStatementsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetBankFeedStatementsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getbillpaymentresponse.go b/tests/mockserver/internal/sdk/models/components/getbillpaymentresponse.go deleted file mode 100644 index e804214d..00000000 --- a/tests/mockserver/internal/sdk/models/components/getbillpaymentresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetBillPaymentResponse - Bill Payment -type GetBillPaymentResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data BillPayment `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetBillPaymentResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetBillPaymentResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetBillPaymentResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetBillPaymentResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetBillPaymentResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetBillPaymentResponse) GetData() BillPayment { - if o == nil { - return BillPayment{} - } - return o.Data -} - -func (o *GetBillPaymentResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getbillpaymentsresponse.go b/tests/mockserver/internal/sdk/models/components/getbillpaymentsresponse.go deleted file mode 100644 index b62cbe80..00000000 --- a/tests/mockserver/internal/sdk/models/components/getbillpaymentsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetBillPaymentsResponse - Bill Payments -type GetBillPaymentsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []BillPayment `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetBillPaymentsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetBillPaymentsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetBillPaymentsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetBillPaymentsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetBillPaymentsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetBillPaymentsResponse) GetData() []BillPayment { - if o == nil { - return []BillPayment{} - } - return o.Data -} - -func (o *GetBillPaymentsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetBillPaymentsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetBillPaymentsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getbillresponse.go b/tests/mockserver/internal/sdk/models/components/getbillresponse.go deleted file mode 100644 index 7929185c..00000000 --- a/tests/mockserver/internal/sdk/models/components/getbillresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetBillResponse - Bill -type GetBillResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Bill `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetBillResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetBillResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetBillResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetBillResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetBillResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetBillResponse) GetData() Bill { - if o == nil { - return Bill{} - } - return o.Data -} - -func (o *GetBillResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getbillsresponse.go b/tests/mockserver/internal/sdk/models/components/getbillsresponse.go deleted file mode 100644 index a705fce3..00000000 --- a/tests/mockserver/internal/sdk/models/components/getbillsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetBillsResponse - Bills -type GetBillsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Bill `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetBillsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetBillsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetBillsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetBillsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetBillsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetBillsResponse) GetData() []Bill { - if o == nil { - return []Bill{} - } - return o.Data -} - -func (o *GetBillsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetBillsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetBillsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getcategoriesresponse.go b/tests/mockserver/internal/sdk/models/components/getcategoriesresponse.go deleted file mode 100644 index 6478f971..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcategoriesresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetCategoriesResponse - Categories -type GetCategoriesResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Category `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetCategoriesResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetCategoriesResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetCategoriesResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetCategoriesResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetCategoriesResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetCategoriesResponse) GetData() []Category { - if o == nil { - return []Category{} - } - return o.Data -} - -func (o *GetCategoriesResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetCategoriesResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetCategoriesResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getcategoryresponse.go b/tests/mockserver/internal/sdk/models/components/getcategoryresponse.go deleted file mode 100644 index 67a7670e..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcategoryresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetCategoryResponse - Category -type GetCategoryResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Category `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetCategoryResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetCategoryResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetCategoryResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetCategoryResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetCategoryResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetCategoryResponse) GetData() Category { - if o == nil { - return Category{} - } - return o.Data -} - -func (o *GetCategoryResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getcollectionresponse.go b/tests/mockserver/internal/sdk/models/components/getcollectionresponse.go deleted file mode 100644 index 5f7e5389..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcollectionresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetCollectionResponse - Get a Collection -type GetCollectionResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Collection `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetCollectionResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetCollectionResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetCollectionResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetCollectionResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetCollectionResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetCollectionResponse) GetData() Collection { - if o == nil { - return Collection{} - } - return o.Data -} - -func (o *GetCollectionResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getcollectionsresponse.go b/tests/mockserver/internal/sdk/models/components/getcollectionsresponse.go deleted file mode 100644 index a3a4ff28..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcollectionsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetCollectionsResponse - List Collections -type GetCollectionsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Collection `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetCollectionsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetCollectionsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetCollectionsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetCollectionsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetCollectionsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetCollectionsResponse) GetData() []Collection { - if o == nil { - return []Collection{} - } - return o.Data -} - -func (o *GetCollectionsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetCollectionsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetCollectionsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getcollectiontagsresponse.go b/tests/mockserver/internal/sdk/models/components/getcollectiontagsresponse.go deleted file mode 100644 index dc8f49c3..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcollectiontagsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetCollectionTagsResponse - List Tags -type GetCollectionTagsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []CollectionTag `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetCollectionTagsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetCollectionTagsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetCollectionTagsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetCollectionTagsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetCollectionTagsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetCollectionTagsResponse) GetData() []CollectionTag { - if o == nil { - return []CollectionTag{} - } - return o.Data -} - -func (o *GetCollectionTagsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetCollectionTagsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetCollectionTagsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getcollectionuserresponse.go b/tests/mockserver/internal/sdk/models/components/getcollectionuserresponse.go deleted file mode 100644 index 09955590..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcollectionuserresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetCollectionUserResponse - User -type GetCollectionUserResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data CollectionUser `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetCollectionUserResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetCollectionUserResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetCollectionUserResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetCollectionUserResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetCollectionUserResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetCollectionUserResponse) GetData() CollectionUser { - if o == nil { - return CollectionUser{} - } - return o.Data -} - -func (o *GetCollectionUserResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getcollectionusersresponse.go b/tests/mockserver/internal/sdk/models/components/getcollectionusersresponse.go deleted file mode 100644 index e0290f1a..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcollectionusersresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetCollectionUsersResponse - Users -type GetCollectionUsersResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []CollectionUser `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetCollectionUsersResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetCollectionUsersResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetCollectionUsersResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetCollectionUsersResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetCollectionUsersResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetCollectionUsersResponse) GetData() []CollectionUser { - if o == nil { - return []CollectionUser{} - } - return o.Data -} - -func (o *GetCollectionUsersResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetCollectionUsersResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetCollectionUsersResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getcommentresponse.go b/tests/mockserver/internal/sdk/models/components/getcommentresponse.go deleted file mode 100644 index b258ad79..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcommentresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetCommentResponse - Get a Comment -type GetCommentResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data CollectionTicketComment `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetCommentResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetCommentResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetCommentResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetCommentResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetCommentResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetCommentResponse) GetData() CollectionTicketComment { - if o == nil { - return CollectionTicketComment{} - } - return o.Data -} - -func (o *GetCommentResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getcommentsresponse.go b/tests/mockserver/internal/sdk/models/components/getcommentsresponse.go deleted file mode 100644 index 86b5c2cc..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcommentsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetCommentsResponse - List Comments -type GetCommentsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []CollectionTicketComment `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetCommentsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetCommentsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetCommentsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetCommentsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetCommentsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetCommentsResponse) GetData() []CollectionTicketComment { - if o == nil { - return []CollectionTicketComment{} - } - return o.Data -} - -func (o *GetCommentsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetCommentsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetCommentsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getcompaniesresponse.go b/tests/mockserver/internal/sdk/models/components/getcompaniesresponse.go deleted file mode 100644 index e78a37bb..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcompaniesresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetCompaniesResponse - Companies -type GetCompaniesResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Company `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetCompaniesResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetCompaniesResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetCompaniesResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetCompaniesResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetCompaniesResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetCompaniesResponse) GetData() []Company { - if o == nil { - return []Company{} - } - return o.Data -} - -func (o *GetCompaniesResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetCompaniesResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetCompaniesResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getcompanyinforesponse.go b/tests/mockserver/internal/sdk/models/components/getcompanyinforesponse.go deleted file mode 100644 index e691edbb..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcompanyinforesponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetCompanyInfoResponse - CompanyInfo -type GetCompanyInfoResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data CompanyInfo `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetCompanyInfoResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetCompanyInfoResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetCompanyInfoResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetCompanyInfoResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetCompanyInfoResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetCompanyInfoResponse) GetData() CompanyInfo { - if o == nil { - return CompanyInfo{} - } - return o.Data -} - -func (o *GetCompanyInfoResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getcompanyresponse.go b/tests/mockserver/internal/sdk/models/components/getcompanyresponse.go deleted file mode 100644 index 0685b942..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcompanyresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetCompanyResponse - Company -type GetCompanyResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Company `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetCompanyResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetCompanyResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetCompanyResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetCompanyResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetCompanyResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetCompanyResponse) GetData() Company { - if o == nil { - return Company{} - } - return o.Data -} - -func (o *GetCompanyResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getconnectionresponse.go b/tests/mockserver/internal/sdk/models/components/getconnectionresponse.go deleted file mode 100644 index 3b288712..00000000 --- a/tests/mockserver/internal/sdk/models/components/getconnectionresponse.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetConnectionResponse - Connection -type GetConnectionResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data Connection `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetConnectionResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetConnectionResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetConnectionResponse) GetData() Connection { - if o == nil { - return Connection{} - } - return o.Data -} - -func (o *GetConnectionResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getconnectionsresponse.go b/tests/mockserver/internal/sdk/models/components/getconnectionsresponse.go deleted file mode 100644 index 5674d030..00000000 --- a/tests/mockserver/internal/sdk/models/components/getconnectionsresponse.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetConnectionsResponse - Connections -type GetConnectionsResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data []Connection `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetConnectionsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetConnectionsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetConnectionsResponse) GetData() []Connection { - if o == nil { - return []Connection{} - } - return o.Data -} - -func (o *GetConnectionsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getconnectorresourceresponse.go b/tests/mockserver/internal/sdk/models/components/getconnectorresourceresponse.go deleted file mode 100644 index 2f8fb510..00000000 --- a/tests/mockserver/internal/sdk/models/components/getconnectorresourceresponse.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetConnectorResourceResponse - ConnectorResources -type GetConnectorResourceResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data ConnectorResource `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetConnectorResourceResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetConnectorResourceResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetConnectorResourceResponse) GetData() ConnectorResource { - if o == nil { - return ConnectorResource{} - } - return o.Data -} - -func (o *GetConnectorResourceResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetConnectorResourceResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetConnectorResourceResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getconnectorresponse.go b/tests/mockserver/internal/sdk/models/components/getconnectorresponse.go deleted file mode 100644 index 2db82bfc..00000000 --- a/tests/mockserver/internal/sdk/models/components/getconnectorresponse.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetConnectorResponse - Connectors -type GetConnectorResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data Connector `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetConnectorResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetConnectorResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetConnectorResponse) GetData() Connector { - if o == nil { - return Connector{} - } - return o.Data -} - -func (o *GetConnectorResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetConnectorResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetConnectorResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getconnectorsresponse.go b/tests/mockserver/internal/sdk/models/components/getconnectorsresponse.go deleted file mode 100644 index 3032d4bd..00000000 --- a/tests/mockserver/internal/sdk/models/components/getconnectorsresponse.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetConnectorsResponse - Connectors -type GetConnectorsResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data []Connector `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetConnectorsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetConnectorsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetConnectorsResponse) GetData() []Connector { - if o == nil { - return []Connector{} - } - return o.Data -} - -func (o *GetConnectorsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetConnectorsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetConnectorsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getconsumerresponse.go b/tests/mockserver/internal/sdk/models/components/getconsumerresponse.go deleted file mode 100644 index dd2e8aad..00000000 --- a/tests/mockserver/internal/sdk/models/components/getconsumerresponse.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetConsumerResponse - Consumer -type GetConsumerResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data Consumer `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetConsumerResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetConsumerResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetConsumerResponse) GetData() Consumer { - if o == nil { - return Consumer{} - } - return o.Data -} - -func (o *GetConsumerResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getconsumersresponse.go b/tests/mockserver/internal/sdk/models/components/getconsumersresponse.go deleted file mode 100644 index 341dda54..00000000 --- a/tests/mockserver/internal/sdk/models/components/getconsumersresponse.go +++ /dev/null @@ -1,136 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type GetConsumersResponseData struct { - ConsumerID *string `json:"consumer_id,omitempty"` - ApplicationID *string `json:"application_id,omitempty"` - // The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. - Metadata *ConsumerMetadata `json:"metadata,omitempty"` - AggregatedRequestCount *float64 `json:"aggregated_request_count,omitempty"` - RequestCounts *RequestCountAllocation `json:"request_counts,omitempty"` - Created *string `json:"created,omitempty"` - Modified *string `json:"modified,omitempty"` - RequestCountUpdated *string `json:"request_count_updated,omitempty"` - Services []string `json:"services,omitempty"` -} - -func (o *GetConsumersResponseData) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *GetConsumersResponseData) GetApplicationID() *string { - if o == nil { - return nil - } - return o.ApplicationID -} - -func (o *GetConsumersResponseData) GetMetadata() *ConsumerMetadata { - if o == nil { - return nil - } - return o.Metadata -} - -func (o *GetConsumersResponseData) GetAggregatedRequestCount() *float64 { - if o == nil { - return nil - } - return o.AggregatedRequestCount -} - -func (o *GetConsumersResponseData) GetRequestCounts() *RequestCountAllocation { - if o == nil { - return nil - } - return o.RequestCounts -} - -func (o *GetConsumersResponseData) GetCreated() *string { - if o == nil { - return nil - } - return o.Created -} - -func (o *GetConsumersResponseData) GetModified() *string { - if o == nil { - return nil - } - return o.Modified -} - -func (o *GetConsumersResponseData) GetRequestCountUpdated() *string { - if o == nil { - return nil - } - return o.RequestCountUpdated -} - -func (o *GetConsumersResponseData) GetServices() []string { - if o == nil { - return nil - } - return o.Services -} - -// GetConsumersResponse - Consumers -type GetConsumersResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data []GetConsumersResponseData `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetConsumersResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetConsumersResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetConsumersResponse) GetData() []GetConsumersResponseData { - if o == nil { - return []GetConsumersResponseData{} - } - return o.Data -} - -func (o *GetConsumersResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetConsumersResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetConsumersResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getcontactresponse.go b/tests/mockserver/internal/sdk/models/components/getcontactresponse.go deleted file mode 100644 index 7f05a6b8..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcontactresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetContactResponse - Contact -type GetContactResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Contact `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetContactResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetContactResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetContactResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetContactResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetContactResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetContactResponse) GetData() Contact { - if o == nil { - return Contact{} - } - return o.Data -} - -func (o *GetContactResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getcontactsresponse.go b/tests/mockserver/internal/sdk/models/components/getcontactsresponse.go deleted file mode 100644 index efe9af38..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcontactsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetContactsResponse - Contacts -type GetContactsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Contact `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetContactsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetContactsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetContactsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetContactsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetContactsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetContactsResponse) GetData() []Contact { - if o == nil { - return []Contact{} - } - return o.Data -} - -func (o *GetContactsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetContactsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetContactsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getcreditnoteresponse.go b/tests/mockserver/internal/sdk/models/components/getcreditnoteresponse.go deleted file mode 100644 index 31a6f32a..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcreditnoteresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetCreditNoteResponse - Credit Note -type GetCreditNoteResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data CreditNote `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetCreditNoteResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetCreditNoteResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetCreditNoteResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetCreditNoteResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetCreditNoteResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetCreditNoteResponse) GetData() CreditNote { - if o == nil { - return CreditNote{} - } - return o.Data -} - -func (o *GetCreditNoteResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getcreditnotesresponse.go b/tests/mockserver/internal/sdk/models/components/getcreditnotesresponse.go deleted file mode 100644 index bf0cf812..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcreditnotesresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetCreditNotesResponse - Credit Notes -type GetCreditNotesResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []CreditNote `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetCreditNotesResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetCreditNotesResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetCreditNotesResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetCreditNotesResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetCreditNotesResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetCreditNotesResponse) GetData() []CreditNote { - if o == nil { - return []CreditNote{} - } - return o.Data -} - -func (o *GetCreditNotesResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetCreditNotesResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetCreditNotesResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getcustomerresponse.go b/tests/mockserver/internal/sdk/models/components/getcustomerresponse.go deleted file mode 100644 index 4dea6def..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcustomerresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetCustomerResponse - Customer -type GetCustomerResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Customer `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetCustomerResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetCustomerResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetCustomerResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetCustomerResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetCustomerResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetCustomerResponse) GetData() Customer { - if o == nil { - return Customer{} - } - return o.Data -} - -func (o *GetCustomerResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getcustomersresponse.go b/tests/mockserver/internal/sdk/models/components/getcustomersresponse.go deleted file mode 100644 index 7915265d..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcustomersresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetCustomersResponse - Customers -type GetCustomersResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Customer `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetCustomersResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetCustomersResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetCustomersResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetCustomersResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetCustomersResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetCustomersResponse) GetData() []Customer { - if o == nil { - return []Customer{} - } - return o.Data -} - -func (o *GetCustomersResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetCustomersResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetCustomersResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getcustomfieldsresponse.go b/tests/mockserver/internal/sdk/models/components/getcustomfieldsresponse.go deleted file mode 100644 index 92ca31c2..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcustomfieldsresponse.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetCustomFieldsResponse - Custom mapping -type GetCustomFieldsResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data []CustomFieldFinder `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetCustomFieldsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetCustomFieldsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetCustomFieldsResponse) GetData() []CustomFieldFinder { - if o == nil { - return []CustomFieldFinder{} - } - return o.Data -} - -func (o *GetCustomFieldsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getcustommappingsresponse.go b/tests/mockserver/internal/sdk/models/components/getcustommappingsresponse.go deleted file mode 100644 index 8bde743f..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcustommappingsresponse.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetCustomMappingsResponse - Custom mapping -type GetCustomMappingsResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data []CustomMapping `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetCustomMappingsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetCustomMappingsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetCustomMappingsResponse) GetData() []CustomMapping { - if o == nil { - return []CustomMapping{} - } - return o.Data -} - -func (o *GetCustomMappingsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getcustomobjectresponse.go b/tests/mockserver/internal/sdk/models/components/getcustomobjectresponse.go deleted file mode 100644 index b5906967..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcustomobjectresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetCustomObjectResponse - Custom object -type GetCustomObjectResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data CustomObject `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetCustomObjectResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetCustomObjectResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetCustomObjectResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetCustomObjectResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetCustomObjectResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetCustomObjectResponse) GetData() CustomObject { - if o == nil { - return CustomObject{} - } - return o.Data -} - -func (o *GetCustomObjectResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getcustomobjectschemaresponse.go b/tests/mockserver/internal/sdk/models/components/getcustomobjectschemaresponse.go deleted file mode 100644 index f21f895c..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcustomobjectschemaresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetCustomObjectSchemaResponse - Custom object schema -type GetCustomObjectSchemaResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data CustomObjectSchema `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetCustomObjectSchemaResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetCustomObjectSchemaResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetCustomObjectSchemaResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetCustomObjectSchemaResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetCustomObjectSchemaResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetCustomObjectSchemaResponse) GetData() CustomObjectSchema { - if o == nil { - return CustomObjectSchema{} - } - return o.Data -} - -func (o *GetCustomObjectSchemaResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getcustomobjectschemasresponse.go b/tests/mockserver/internal/sdk/models/components/getcustomobjectschemasresponse.go deleted file mode 100644 index e94133fe..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcustomobjectschemasresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetCustomObjectSchemasResponse - Custom object schemas -type GetCustomObjectSchemasResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []CustomObjectSchema `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetCustomObjectSchemasResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetCustomObjectSchemasResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetCustomObjectSchemasResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetCustomObjectSchemasResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetCustomObjectSchemasResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetCustomObjectSchemasResponse) GetData() []CustomObjectSchema { - if o == nil { - return []CustomObjectSchema{} - } - return o.Data -} - -func (o *GetCustomObjectSchemasResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetCustomObjectSchemasResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetCustomObjectSchemasResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getcustomobjectsresponse.go b/tests/mockserver/internal/sdk/models/components/getcustomobjectsresponse.go deleted file mode 100644 index b4adfe5b..00000000 --- a/tests/mockserver/internal/sdk/models/components/getcustomobjectsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetCustomObjectsResponse - Custom objects -type GetCustomObjectsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []CustomObject `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetCustomObjectsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetCustomObjectsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetCustomObjectsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetCustomObjectsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetCustomObjectsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetCustomObjectsResponse) GetData() []CustomObject { - if o == nil { - return []CustomObject{} - } - return o.Data -} - -func (o *GetCustomObjectsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetCustomObjectsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetCustomObjectsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getdepartmentresponse.go b/tests/mockserver/internal/sdk/models/components/getdepartmentresponse.go deleted file mode 100644 index 5e91fc8d..00000000 --- a/tests/mockserver/internal/sdk/models/components/getdepartmentresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetDepartmentResponse - Departments -type GetDepartmentResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Department `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetDepartmentResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetDepartmentResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetDepartmentResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetDepartmentResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetDepartmentResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetDepartmentResponse) GetData() Department { - if o == nil { - return Department{} - } - return o.Data -} - -func (o *GetDepartmentResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getdepartmentsresponse.go b/tests/mockserver/internal/sdk/models/components/getdepartmentsresponse.go deleted file mode 100644 index d20fdd6d..00000000 --- a/tests/mockserver/internal/sdk/models/components/getdepartmentsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetDepartmentsResponse - Departments -type GetDepartmentsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Department `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetDepartmentsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetDepartmentsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetDepartmentsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetDepartmentsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetDepartmentsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetDepartmentsResponse) GetData() []Department { - if o == nil { - return []Department{} - } - return o.Data -} - -func (o *GetDepartmentsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetDepartmentsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetDepartmentsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getdrivegroupresponse.go b/tests/mockserver/internal/sdk/models/components/getdrivegroupresponse.go deleted file mode 100644 index fe71df7c..00000000 --- a/tests/mockserver/internal/sdk/models/components/getdrivegroupresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetDriveGroupResponse - DriveGroups -type GetDriveGroupResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data DriveGroup `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetDriveGroupResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetDriveGroupResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetDriveGroupResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetDriveGroupResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetDriveGroupResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetDriveGroupResponse) GetData() DriveGroup { - if o == nil { - return DriveGroup{} - } - return o.Data -} - -func (o *GetDriveGroupResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getdrivegroupsresponse.go b/tests/mockserver/internal/sdk/models/components/getdrivegroupsresponse.go deleted file mode 100644 index 5d1b68c4..00000000 --- a/tests/mockserver/internal/sdk/models/components/getdrivegroupsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetDriveGroupsResponse - DriveGroups -type GetDriveGroupsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []DriveGroup `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetDriveGroupsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetDriveGroupsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetDriveGroupsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetDriveGroupsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetDriveGroupsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetDriveGroupsResponse) GetData() []DriveGroup { - if o == nil { - return []DriveGroup{} - } - return o.Data -} - -func (o *GetDriveGroupsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetDriveGroupsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetDriveGroupsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getdriveresponse.go b/tests/mockserver/internal/sdk/models/components/getdriveresponse.go deleted file mode 100644 index 0584d4ea..00000000 --- a/tests/mockserver/internal/sdk/models/components/getdriveresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetDriveResponse - Drives -type GetDriveResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Drive `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetDriveResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetDriveResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetDriveResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetDriveResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetDriveResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetDriveResponse) GetData() Drive { - if o == nil { - return Drive{} - } - return o.Data -} - -func (o *GetDriveResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getdrivesresponse.go b/tests/mockserver/internal/sdk/models/components/getdrivesresponse.go deleted file mode 100644 index 6304503c..00000000 --- a/tests/mockserver/internal/sdk/models/components/getdrivesresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetDrivesResponse - Drives -type GetDrivesResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Drive `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetDrivesResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetDrivesResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetDrivesResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetDrivesResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetDrivesResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetDrivesResponse) GetData() []Drive { - if o == nil { - return []Drive{} - } - return o.Data -} - -func (o *GetDrivesResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetDrivesResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetDrivesResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getecommercecustomerresponse.go b/tests/mockserver/internal/sdk/models/components/getecommercecustomerresponse.go deleted file mode 100644 index 232d80b1..00000000 --- a/tests/mockserver/internal/sdk/models/components/getecommercecustomerresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetEcommerceCustomerResponse - Customers -type GetEcommerceCustomerResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data EcommerceCustomer `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetEcommerceCustomerResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetEcommerceCustomerResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetEcommerceCustomerResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetEcommerceCustomerResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetEcommerceCustomerResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetEcommerceCustomerResponse) GetData() EcommerceCustomer { - if o == nil { - return EcommerceCustomer{} - } - return o.Data -} - -func (o *GetEcommerceCustomerResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getecommercecustomersresponse.go b/tests/mockserver/internal/sdk/models/components/getecommercecustomersresponse.go deleted file mode 100644 index 0112a2fe..00000000 --- a/tests/mockserver/internal/sdk/models/components/getecommercecustomersresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetEcommerceCustomersResponse - Customers -type GetEcommerceCustomersResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []EcommerceCustomer `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetEcommerceCustomersResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetEcommerceCustomersResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetEcommerceCustomersResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetEcommerceCustomersResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetEcommerceCustomersResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetEcommerceCustomersResponse) GetData() []EcommerceCustomer { - if o == nil { - return []EcommerceCustomer{} - } - return o.Data -} - -func (o *GetEcommerceCustomersResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetEcommerceCustomersResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetEcommerceCustomersResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getecommerceorderresponse.go b/tests/mockserver/internal/sdk/models/components/getecommerceorderresponse.go deleted file mode 100644 index 4968f658..00000000 --- a/tests/mockserver/internal/sdk/models/components/getecommerceorderresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetEcommerceOrderResponse - Orders -type GetEcommerceOrderResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data EcommerceOrder `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetEcommerceOrderResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetEcommerceOrderResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetEcommerceOrderResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetEcommerceOrderResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetEcommerceOrderResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetEcommerceOrderResponse) GetData() EcommerceOrder { - if o == nil { - return EcommerceOrder{} - } - return o.Data -} - -func (o *GetEcommerceOrderResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getecommerceordersresponse.go b/tests/mockserver/internal/sdk/models/components/getecommerceordersresponse.go deleted file mode 100644 index a2b7964b..00000000 --- a/tests/mockserver/internal/sdk/models/components/getecommerceordersresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetEcommerceOrdersResponse - Orders -type GetEcommerceOrdersResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []EcommerceOrder `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetEcommerceOrdersResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetEcommerceOrdersResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetEcommerceOrdersResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetEcommerceOrdersResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetEcommerceOrdersResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetEcommerceOrdersResponse) GetData() []EcommerceOrder { - if o == nil { - return []EcommerceOrder{} - } - return o.Data -} - -func (o *GetEcommerceOrdersResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetEcommerceOrdersResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetEcommerceOrdersResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getemployeepayrollresponse.go b/tests/mockserver/internal/sdk/models/components/getemployeepayrollresponse.go deleted file mode 100644 index 808c028c..00000000 --- a/tests/mockserver/internal/sdk/models/components/getemployeepayrollresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetEmployeePayrollResponse - Payrolls -type GetEmployeePayrollResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data EmployeePayroll `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetEmployeePayrollResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetEmployeePayrollResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetEmployeePayrollResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetEmployeePayrollResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetEmployeePayrollResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetEmployeePayrollResponse) GetData() EmployeePayroll { - if o == nil { - return EmployeePayroll{} - } - return o.Data -} - -func (o *GetEmployeePayrollResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getemployeepayrollsresponse.go b/tests/mockserver/internal/sdk/models/components/getemployeepayrollsresponse.go deleted file mode 100644 index 683aa793..00000000 --- a/tests/mockserver/internal/sdk/models/components/getemployeepayrollsresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetEmployeePayrollsResponse - EmployeePayrolls -type GetEmployeePayrollsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []EmployeePayroll `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetEmployeePayrollsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetEmployeePayrollsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetEmployeePayrollsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetEmployeePayrollsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetEmployeePayrollsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetEmployeePayrollsResponse) GetData() []EmployeePayroll { - if o == nil { - return []EmployeePayroll{} - } - return o.Data -} - -func (o *GetEmployeePayrollsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getemployeeresponse.go b/tests/mockserver/internal/sdk/models/components/getemployeeresponse.go deleted file mode 100644 index 979de851..00000000 --- a/tests/mockserver/internal/sdk/models/components/getemployeeresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetEmployeeResponse - Employees -type GetEmployeeResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Employee `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetEmployeeResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetEmployeeResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetEmployeeResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetEmployeeResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetEmployeeResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetEmployeeResponse) GetData() Employee { - if o == nil { - return Employee{} - } - return o.Data -} - -func (o *GetEmployeeResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getemployeeschedulesresponse.go b/tests/mockserver/internal/sdk/models/components/getemployeeschedulesresponse.go deleted file mode 100644 index 733008ef..00000000 --- a/tests/mockserver/internal/sdk/models/components/getemployeeschedulesresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetEmployeeSchedulesResponse - EmployeeSchedules -type GetEmployeeSchedulesResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data EmployeeSchedules `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetEmployeeSchedulesResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetEmployeeSchedulesResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetEmployeeSchedulesResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetEmployeeSchedulesResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetEmployeeSchedulesResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetEmployeeSchedulesResponse) GetData() EmployeeSchedules { - if o == nil { - return EmployeeSchedules{} - } - return o.Data -} - -func (o *GetEmployeeSchedulesResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getemployeesresponse.go b/tests/mockserver/internal/sdk/models/components/getemployeesresponse.go deleted file mode 100644 index 6c39933e..00000000 --- a/tests/mockserver/internal/sdk/models/components/getemployeesresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetEmployeesResponse - Employees -type GetEmployeesResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Employee `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetEmployeesResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetEmployeesResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetEmployeesResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetEmployeesResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetEmployeesResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetEmployeesResponse) GetData() []Employee { - if o == nil { - return []Employee{} - } - return o.Data -} - -func (o *GetEmployeesResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetEmployeesResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetEmployeesResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getexpenseresponse.go b/tests/mockserver/internal/sdk/models/components/getexpenseresponse.go deleted file mode 100644 index 22638817..00000000 --- a/tests/mockserver/internal/sdk/models/components/getexpenseresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetExpenseResponse - Expenses -type GetExpenseResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Expense `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetExpenseResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetExpenseResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetExpenseResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetExpenseResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetExpenseResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetExpenseResponse) GetData() Expense { - if o == nil { - return Expense{} - } - return o.Data -} - -func (o *GetExpenseResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getexpensesresponse.go b/tests/mockserver/internal/sdk/models/components/getexpensesresponse.go deleted file mode 100644 index 46e19423..00000000 --- a/tests/mockserver/internal/sdk/models/components/getexpensesresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetExpensesResponse - Expenses -type GetExpensesResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Expense `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetExpensesResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetExpensesResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetExpensesResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetExpensesResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetExpensesResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetExpensesResponse) GetData() []Expense { - if o == nil { - return []Expense{} - } - return o.Data -} - -func (o *GetExpensesResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetExpensesResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetExpensesResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getfileresponse.go b/tests/mockserver/internal/sdk/models/components/getfileresponse.go deleted file mode 100644 index a538ba52..00000000 --- a/tests/mockserver/internal/sdk/models/components/getfileresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetFileResponse - File -type GetFileResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data UnifiedFile `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetFileResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetFileResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetFileResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetFileResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetFileResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetFileResponse) GetData() UnifiedFile { - if o == nil { - return UnifiedFile{} - } - return o.Data -} - -func (o *GetFileResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getfilesresponse.go b/tests/mockserver/internal/sdk/models/components/getfilesresponse.go deleted file mode 100644 index f8f1b291..00000000 --- a/tests/mockserver/internal/sdk/models/components/getfilesresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetFilesResponse - Files -type GetFilesResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []UnifiedFile `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetFilesResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetFilesResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetFilesResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetFilesResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetFilesResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetFilesResponse) GetData() []UnifiedFile { - if o == nil { - return []UnifiedFile{} - } - return o.Data -} - -func (o *GetFilesResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetFilesResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetFilesResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getfolderresponse.go b/tests/mockserver/internal/sdk/models/components/getfolderresponse.go deleted file mode 100644 index 9e4e3342..00000000 --- a/tests/mockserver/internal/sdk/models/components/getfolderresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetFolderResponse - Folders -type GetFolderResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Folder `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetFolderResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetFolderResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetFolderResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetFolderResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetFolderResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetFolderResponse) GetData() Folder { - if o == nil { - return Folder{} - } - return o.Data -} - -func (o *GetFolderResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/gethriscompaniesresponse.go b/tests/mockserver/internal/sdk/models/components/gethriscompaniesresponse.go deleted file mode 100644 index 02bce348..00000000 --- a/tests/mockserver/internal/sdk/models/components/gethriscompaniesresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetHrisCompaniesResponse - Companies -type GetHrisCompaniesResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []HrisCompany `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetHrisCompaniesResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetHrisCompaniesResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetHrisCompaniesResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetHrisCompaniesResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetHrisCompaniesResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetHrisCompaniesResponse) GetData() []HrisCompany { - if o == nil { - return []HrisCompany{} - } - return o.Data -} - -func (o *GetHrisCompaniesResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetHrisCompaniesResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetHrisCompaniesResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/gethriscompanyresponse.go b/tests/mockserver/internal/sdk/models/components/gethriscompanyresponse.go deleted file mode 100644 index d920c990..00000000 --- a/tests/mockserver/internal/sdk/models/components/gethriscompanyresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetHrisCompanyResponse - Company -type GetHrisCompanyResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data HrisCompany `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetHrisCompanyResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetHrisCompanyResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetHrisCompanyResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetHrisCompanyResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetHrisCompanyResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetHrisCompanyResponse) GetData() HrisCompany { - if o == nil { - return HrisCompany{} - } - return o.Data -} - -func (o *GetHrisCompanyResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getinvoiceitemresponse.go b/tests/mockserver/internal/sdk/models/components/getinvoiceitemresponse.go deleted file mode 100644 index d527804f..00000000 --- a/tests/mockserver/internal/sdk/models/components/getinvoiceitemresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetInvoiceItemResponse - InvoiceItems -type GetInvoiceItemResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data InvoiceItem `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetInvoiceItemResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetInvoiceItemResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetInvoiceItemResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetInvoiceItemResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetInvoiceItemResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetInvoiceItemResponse) GetData() InvoiceItem { - if o == nil { - return InvoiceItem{} - } - return o.Data -} - -func (o *GetInvoiceItemResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getinvoiceitemsresponse.go b/tests/mockserver/internal/sdk/models/components/getinvoiceitemsresponse.go deleted file mode 100644 index 0d81becf..00000000 --- a/tests/mockserver/internal/sdk/models/components/getinvoiceitemsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetInvoiceItemsResponse - InvoiceItems -type GetInvoiceItemsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []InvoiceItem `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetInvoiceItemsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetInvoiceItemsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetInvoiceItemsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetInvoiceItemsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetInvoiceItemsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetInvoiceItemsResponse) GetData() []InvoiceItem { - if o == nil { - return []InvoiceItem{} - } - return o.Data -} - -func (o *GetInvoiceItemsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetInvoiceItemsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetInvoiceItemsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getinvoiceresponse.go b/tests/mockserver/internal/sdk/models/components/getinvoiceresponse.go deleted file mode 100644 index 476ac980..00000000 --- a/tests/mockserver/internal/sdk/models/components/getinvoiceresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetInvoiceResponse - Invoice -type GetInvoiceResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Invoice `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetInvoiceResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetInvoiceResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetInvoiceResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetInvoiceResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetInvoiceResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetInvoiceResponse) GetData() Invoice { - if o == nil { - return Invoice{} - } - return o.Data -} - -func (o *GetInvoiceResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getinvoicesresponse.go b/tests/mockserver/internal/sdk/models/components/getinvoicesresponse.go deleted file mode 100644 index f235e4ab..00000000 --- a/tests/mockserver/internal/sdk/models/components/getinvoicesresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetInvoicesResponse - Invoices -type GetInvoicesResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Invoice `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetInvoicesResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetInvoicesResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetInvoicesResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetInvoicesResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetInvoicesResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetInvoicesResponse) GetData() []Invoice { - if o == nil { - return []Invoice{} - } - return o.Data -} - -func (o *GetInvoicesResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetInvoicesResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetInvoicesResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getjobresponse.go b/tests/mockserver/internal/sdk/models/components/getjobresponse.go deleted file mode 100644 index dd69a110..00000000 --- a/tests/mockserver/internal/sdk/models/components/getjobresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetJobResponse - Jobs -type GetJobResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Job `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetJobResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetJobResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetJobResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetJobResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetJobResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetJobResponse) GetData() Job { - if o == nil { - return Job{} - } - return o.Data -} - -func (o *GetJobResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getjobsresponse.go b/tests/mockserver/internal/sdk/models/components/getjobsresponse.go deleted file mode 100644 index c4d8477f..00000000 --- a/tests/mockserver/internal/sdk/models/components/getjobsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetJobsResponse - Jobs -type GetJobsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Job `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetJobsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetJobsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetJobsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetJobsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetJobsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetJobsResponse) GetData() []Job { - if o == nil { - return []Job{} - } - return o.Data -} - -func (o *GetJobsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetJobsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetJobsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getjournalentriesresponse.go b/tests/mockserver/internal/sdk/models/components/getjournalentriesresponse.go deleted file mode 100644 index 1cee88bc..00000000 --- a/tests/mockserver/internal/sdk/models/components/getjournalentriesresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetJournalEntriesResponse - JournalEntry -type GetJournalEntriesResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []JournalEntry `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetJournalEntriesResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetJournalEntriesResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetJournalEntriesResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetJournalEntriesResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetJournalEntriesResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetJournalEntriesResponse) GetData() []JournalEntry { - if o == nil { - return []JournalEntry{} - } - return o.Data -} - -func (o *GetJournalEntriesResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetJournalEntriesResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetJournalEntriesResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getjournalentryresponse.go b/tests/mockserver/internal/sdk/models/components/getjournalentryresponse.go deleted file mode 100644 index c7d29ba2..00000000 --- a/tests/mockserver/internal/sdk/models/components/getjournalentryresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetJournalEntryResponse - JournalEntries -type GetJournalEntryResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data JournalEntry `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetJournalEntryResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetJournalEntryResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetJournalEntryResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetJournalEntryResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetJournalEntryResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetJournalEntryResponse) GetData() JournalEntry { - if o == nil { - return JournalEntry{} - } - return o.Data -} - -func (o *GetJournalEntryResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getleadresponse.go b/tests/mockserver/internal/sdk/models/components/getleadresponse.go deleted file mode 100644 index 17d0e738..00000000 --- a/tests/mockserver/internal/sdk/models/components/getleadresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetLeadResponse - Lead -type GetLeadResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Lead `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetLeadResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetLeadResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetLeadResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetLeadResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetLeadResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetLeadResponse) GetData() Lead { - if o == nil { - return Lead{} - } - return o.Data -} - -func (o *GetLeadResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getleadsresponse.go b/tests/mockserver/internal/sdk/models/components/getleadsresponse.go deleted file mode 100644 index b6837b2b..00000000 --- a/tests/mockserver/internal/sdk/models/components/getleadsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetLeadsResponse - Leads -type GetLeadsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Lead `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetLeadsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetLeadsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetLeadsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetLeadsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetLeadsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetLeadsResponse) GetData() []Lead { - if o == nil { - return []Lead{} - } - return o.Data -} - -func (o *GetLeadsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetLeadsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetLeadsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getledgeraccountresponse.go b/tests/mockserver/internal/sdk/models/components/getledgeraccountresponse.go deleted file mode 100644 index a8484ddd..00000000 --- a/tests/mockserver/internal/sdk/models/components/getledgeraccountresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetLedgerAccountResponse - LedgerAccount -type GetLedgerAccountResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data LedgerAccount `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetLedgerAccountResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetLedgerAccountResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetLedgerAccountResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetLedgerAccountResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetLedgerAccountResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetLedgerAccountResponse) GetData() LedgerAccount { - if o == nil { - return LedgerAccount{} - } - return o.Data -} - -func (o *GetLedgerAccountResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getledgeraccountsresponse.go b/tests/mockserver/internal/sdk/models/components/getledgeraccountsresponse.go deleted file mode 100644 index 4fb72b4b..00000000 --- a/tests/mockserver/internal/sdk/models/components/getledgeraccountsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetLedgerAccountsResponse - LedgerAccounts -type GetLedgerAccountsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []LedgerAccount `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetLedgerAccountsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetLedgerAccountsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetLedgerAccountsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetLedgerAccountsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetLedgerAccountsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetLedgerAccountsResponse) GetData() []LedgerAccount { - if o == nil { - return []LedgerAccount{} - } - return o.Data -} - -func (o *GetLedgerAccountsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetLedgerAccountsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetLedgerAccountsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getlogsresponse.go b/tests/mockserver/internal/sdk/models/components/getlogsresponse.go deleted file mode 100644 index 89d7fe3c..00000000 --- a/tests/mockserver/internal/sdk/models/components/getlogsresponse.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetLogsResponse - Logs -type GetLogsResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data []Log `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetLogsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetLogsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetLogsResponse) GetData() []Log { - if o == nil { - return []Log{} - } - return o.Data -} - -func (o *GetLogsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetLogsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetLogsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getmessageresponse.go b/tests/mockserver/internal/sdk/models/components/getmessageresponse.go deleted file mode 100644 index afc919bc..00000000 --- a/tests/mockserver/internal/sdk/models/components/getmessageresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetMessageResponse - Messages -type GetMessageResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Message `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetMessageResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetMessageResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetMessageResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetMessageResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetMessageResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetMessageResponse) GetData() Message { - if o == nil { - return Message{} - } - return o.Data -} - -func (o *GetMessageResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getmessagesresponse.go b/tests/mockserver/internal/sdk/models/components/getmessagesresponse.go deleted file mode 100644 index 8c8082cf..00000000 --- a/tests/mockserver/internal/sdk/models/components/getmessagesresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetMessagesResponse - Messages -type GetMessagesResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Message `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetMessagesResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetMessagesResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetMessagesResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetMessagesResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetMessagesResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetMessagesResponse) GetData() []Message { - if o == nil { - return []Message{} - } - return o.Data -} - -func (o *GetMessagesResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetMessagesResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetMessagesResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getnoteresponse.go b/tests/mockserver/internal/sdk/models/components/getnoteresponse.go deleted file mode 100644 index b5240032..00000000 --- a/tests/mockserver/internal/sdk/models/components/getnoteresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetNoteResponse - Note -type GetNoteResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Note `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetNoteResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetNoteResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetNoteResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetNoteResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetNoteResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetNoteResponse) GetData() Note { - if o == nil { - return Note{} - } - return o.Data -} - -func (o *GetNoteResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getnotesresponse.go b/tests/mockserver/internal/sdk/models/components/getnotesresponse.go deleted file mode 100644 index 5d0a6773..00000000 --- a/tests/mockserver/internal/sdk/models/components/getnotesresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetNotesResponse - Notes -type GetNotesResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Note `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetNotesResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetNotesResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetNotesResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetNotesResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetNotesResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetNotesResponse) GetData() []Note { - if o == nil { - return []Note{} - } - return o.Data -} - -func (o *GetNotesResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetNotesResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetNotesResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getopportunitiesresponse.go b/tests/mockserver/internal/sdk/models/components/getopportunitiesresponse.go deleted file mode 100644 index c1b304e3..00000000 --- a/tests/mockserver/internal/sdk/models/components/getopportunitiesresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetOpportunitiesResponse - Opportunities -type GetOpportunitiesResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Opportunity `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetOpportunitiesResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetOpportunitiesResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetOpportunitiesResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetOpportunitiesResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetOpportunitiesResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetOpportunitiesResponse) GetData() []Opportunity { - if o == nil { - return []Opportunity{} - } - return o.Data -} - -func (o *GetOpportunitiesResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetOpportunitiesResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetOpportunitiesResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getopportunityresponse.go b/tests/mockserver/internal/sdk/models/components/getopportunityresponse.go deleted file mode 100644 index cc8b9b07..00000000 --- a/tests/mockserver/internal/sdk/models/components/getopportunityresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetOpportunityResponse - Opportunity -type GetOpportunityResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Opportunity `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetOpportunityResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetOpportunityResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetOpportunityResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetOpportunityResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetOpportunityResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetOpportunityResponse) GetData() Opportunity { - if o == nil { - return Opportunity{} - } - return o.Data -} - -func (o *GetOpportunityResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getpaymentresponse.go b/tests/mockserver/internal/sdk/models/components/getpaymentresponse.go deleted file mode 100644 index 5194af9f..00000000 --- a/tests/mockserver/internal/sdk/models/components/getpaymentresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetPaymentResponse - Payment -type GetPaymentResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Payment `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetPaymentResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetPaymentResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetPaymentResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetPaymentResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetPaymentResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetPaymentResponse) GetData() Payment { - if o == nil { - return Payment{} - } - return o.Data -} - -func (o *GetPaymentResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getpaymentsresponse.go b/tests/mockserver/internal/sdk/models/components/getpaymentsresponse.go deleted file mode 100644 index 1718d23e..00000000 --- a/tests/mockserver/internal/sdk/models/components/getpaymentsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetPaymentsResponse - Payments -type GetPaymentsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Payment `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetPaymentsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetPaymentsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetPaymentsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetPaymentsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetPaymentsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetPaymentsResponse) GetData() []Payment { - if o == nil { - return []Payment{} - } - return o.Data -} - -func (o *GetPaymentsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetPaymentsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetPaymentsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getpayrollresponse.go b/tests/mockserver/internal/sdk/models/components/getpayrollresponse.go deleted file mode 100644 index d1ef6a45..00000000 --- a/tests/mockserver/internal/sdk/models/components/getpayrollresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetPayrollResponse - Payrolls -type GetPayrollResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Payroll `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetPayrollResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetPayrollResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetPayrollResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetPayrollResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetPayrollResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetPayrollResponse) GetData() Payroll { - if o == nil { - return Payroll{} - } - return o.Data -} - -func (o *GetPayrollResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getpayrollsresponse.go b/tests/mockserver/internal/sdk/models/components/getpayrollsresponse.go deleted file mode 100644 index 72ca4e05..00000000 --- a/tests/mockserver/internal/sdk/models/components/getpayrollsresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetPayrollsResponse - Payrolls -type GetPayrollsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Payroll `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetPayrollsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetPayrollsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetPayrollsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetPayrollsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetPayrollsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetPayrollsResponse) GetData() []Payroll { - if o == nil { - return []Payroll{} - } - return o.Data -} - -func (o *GetPayrollsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getpipelineresponse.go b/tests/mockserver/internal/sdk/models/components/getpipelineresponse.go deleted file mode 100644 index 2594614c..00000000 --- a/tests/mockserver/internal/sdk/models/components/getpipelineresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetPipelineResponse - Pipeline -type GetPipelineResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Pipeline `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetPipelineResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetPipelineResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetPipelineResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetPipelineResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetPipelineResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetPipelineResponse) GetData() Pipeline { - if o == nil { - return Pipeline{} - } - return o.Data -} - -func (o *GetPipelineResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getpipelinesresponse.go b/tests/mockserver/internal/sdk/models/components/getpipelinesresponse.go deleted file mode 100644 index 3731d15a..00000000 --- a/tests/mockserver/internal/sdk/models/components/getpipelinesresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetPipelinesResponse - Pipelines -type GetPipelinesResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Pipeline `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetPipelinesResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetPipelinesResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetPipelinesResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetPipelinesResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetPipelinesResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetPipelinesResponse) GetData() []Pipeline { - if o == nil { - return []Pipeline{} - } - return o.Data -} - -func (o *GetPipelinesResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetPipelinesResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetPipelinesResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getproductresponse.go b/tests/mockserver/internal/sdk/models/components/getproductresponse.go deleted file mode 100644 index 38b62e04..00000000 --- a/tests/mockserver/internal/sdk/models/components/getproductresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetProductResponse - Products -type GetProductResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data EcommerceProduct `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetProductResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetProductResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetProductResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetProductResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetProductResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetProductResponse) GetData() EcommerceProduct { - if o == nil { - return EcommerceProduct{} - } - return o.Data -} - -func (o *GetProductResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getproductsresponse.go b/tests/mockserver/internal/sdk/models/components/getproductsresponse.go deleted file mode 100644 index ebca6173..00000000 --- a/tests/mockserver/internal/sdk/models/components/getproductsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetProductsResponse - Products -type GetProductsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []EcommerceProduct `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetProductsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetProductsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetProductsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetProductsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetProductsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetProductsResponse) GetData() []EcommerceProduct { - if o == nil { - return []EcommerceProduct{} - } - return o.Data -} - -func (o *GetProductsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetProductsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetProductsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getprofitandlossresponse.go b/tests/mockserver/internal/sdk/models/components/getprofitandlossresponse.go deleted file mode 100644 index 594f7818..00000000 --- a/tests/mockserver/internal/sdk/models/components/getprofitandlossresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetProfitAndLossResponse - Profit & Loss Report -type GetProfitAndLossResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data ProfitAndLoss `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetProfitAndLossResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetProfitAndLossResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetProfitAndLossResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetProfitAndLossResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetProfitAndLossResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetProfitAndLossResponse) GetData() ProfitAndLoss { - if o == nil { - return ProfitAndLoss{} - } - return o.Data -} - -func (o *GetProfitAndLossResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getpurchaseorderresponse.go b/tests/mockserver/internal/sdk/models/components/getpurchaseorderresponse.go deleted file mode 100644 index 5963e319..00000000 --- a/tests/mockserver/internal/sdk/models/components/getpurchaseorderresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetPurchaseOrderResponse - PurchaseOrders -type GetPurchaseOrderResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data PurchaseOrder `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetPurchaseOrderResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetPurchaseOrderResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetPurchaseOrderResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetPurchaseOrderResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetPurchaseOrderResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetPurchaseOrderResponse) GetData() PurchaseOrder { - if o == nil { - return PurchaseOrder{} - } - return o.Data -} - -func (o *GetPurchaseOrderResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getpurchaseordersresponse.go b/tests/mockserver/internal/sdk/models/components/getpurchaseordersresponse.go deleted file mode 100644 index 30ffb1fa..00000000 --- a/tests/mockserver/internal/sdk/models/components/getpurchaseordersresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetPurchaseOrdersResponse - PurchaseOrders -type GetPurchaseOrdersResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []PurchaseOrder `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetPurchaseOrdersResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetPurchaseOrdersResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetPurchaseOrdersResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetPurchaseOrdersResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetPurchaseOrdersResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetPurchaseOrdersResponse) GetData() []PurchaseOrder { - if o == nil { - return []PurchaseOrder{} - } - return o.Data -} - -func (o *GetPurchaseOrdersResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetPurchaseOrdersResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetPurchaseOrdersResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getsharedlinkresponse.go b/tests/mockserver/internal/sdk/models/components/getsharedlinkresponse.go deleted file mode 100644 index d3c5ad47..00000000 --- a/tests/mockserver/internal/sdk/models/components/getsharedlinkresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetSharedLinkResponse - Shared Link -type GetSharedLinkResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data SharedLinkOutput `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetSharedLinkResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetSharedLinkResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetSharedLinkResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetSharedLinkResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetSharedLinkResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetSharedLinkResponse) GetData() SharedLinkOutput { - if o == nil { - return SharedLinkOutput{} - } - return o.Data -} - -func (o *GetSharedLinkResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getsharedlinksresponse.go b/tests/mockserver/internal/sdk/models/components/getsharedlinksresponse.go deleted file mode 100644 index 3d6c5500..00000000 --- a/tests/mockserver/internal/sdk/models/components/getsharedlinksresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetSharedLinksResponse - Shared Links -type GetSharedLinksResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []SharedLinkOutput `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetSharedLinksResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetSharedLinksResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetSharedLinksResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetSharedLinksResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetSharedLinksResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetSharedLinksResponse) GetData() []SharedLinkOutput { - if o == nil { - return []SharedLinkOutput{} - } - return o.Data -} - -func (o *GetSharedLinksResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetSharedLinksResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetSharedLinksResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getstoreresponse.go b/tests/mockserver/internal/sdk/models/components/getstoreresponse.go deleted file mode 100644 index c8890c69..00000000 --- a/tests/mockserver/internal/sdk/models/components/getstoreresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetStoreResponse - Stores -type GetStoreResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data EcommerceStore `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetStoreResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetStoreResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetStoreResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetStoreResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetStoreResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetStoreResponse) GetData() EcommerceStore { - if o == nil { - return EcommerceStore{} - } - return o.Data -} - -func (o *GetStoreResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getsubsidiariesresponse.go b/tests/mockserver/internal/sdk/models/components/getsubsidiariesresponse.go deleted file mode 100644 index 74008b73..00000000 --- a/tests/mockserver/internal/sdk/models/components/getsubsidiariesresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetSubsidiariesResponse - Subsidiaries -type GetSubsidiariesResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Subsidiary `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetSubsidiariesResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetSubsidiariesResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetSubsidiariesResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetSubsidiariesResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetSubsidiariesResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetSubsidiariesResponse) GetData() []Subsidiary { - if o == nil { - return []Subsidiary{} - } - return o.Data -} - -func (o *GetSubsidiariesResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetSubsidiariesResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetSubsidiariesResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getsubsidiaryresponse.go b/tests/mockserver/internal/sdk/models/components/getsubsidiaryresponse.go deleted file mode 100644 index 1c5797ec..00000000 --- a/tests/mockserver/internal/sdk/models/components/getsubsidiaryresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetSubsidiaryResponse - Subsidiary -type GetSubsidiaryResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Subsidiary `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetSubsidiaryResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetSubsidiaryResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetSubsidiaryResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetSubsidiaryResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetSubsidiaryResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetSubsidiaryResponse) GetData() Subsidiary { - if o == nil { - return Subsidiary{} - } - return o.Data -} - -func (o *GetSubsidiaryResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getsupplierresponse.go b/tests/mockserver/internal/sdk/models/components/getsupplierresponse.go deleted file mode 100644 index 8b0b63bb..00000000 --- a/tests/mockserver/internal/sdk/models/components/getsupplierresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetSupplierResponse - Supplier -type GetSupplierResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Supplier `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetSupplierResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetSupplierResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetSupplierResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetSupplierResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetSupplierResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetSupplierResponse) GetData() Supplier { - if o == nil { - return Supplier{} - } - return o.Data -} - -func (o *GetSupplierResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getsuppliersresponse.go b/tests/mockserver/internal/sdk/models/components/getsuppliersresponse.go deleted file mode 100644 index 3fc8b5d6..00000000 --- a/tests/mockserver/internal/sdk/models/components/getsuppliersresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetSuppliersResponse - Suppliers -type GetSuppliersResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Supplier `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetSuppliersResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetSuppliersResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetSuppliersResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetSuppliersResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetSuppliersResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetSuppliersResponse) GetData() []Supplier { - if o == nil { - return []Supplier{} - } - return o.Data -} - -func (o *GetSuppliersResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetSuppliersResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetSuppliersResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/gettaxrateresponse.go b/tests/mockserver/internal/sdk/models/components/gettaxrateresponse.go deleted file mode 100644 index 9e64eb8c..00000000 --- a/tests/mockserver/internal/sdk/models/components/gettaxrateresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetTaxRateResponse - TaxRate -type GetTaxRateResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data TaxRate `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetTaxRateResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetTaxRateResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetTaxRateResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetTaxRateResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetTaxRateResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetTaxRateResponse) GetData() TaxRate { - if o == nil { - return TaxRate{} - } - return o.Data -} - -func (o *GetTaxRateResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/gettaxratesresponse.go b/tests/mockserver/internal/sdk/models/components/gettaxratesresponse.go deleted file mode 100644 index f1e8521b..00000000 --- a/tests/mockserver/internal/sdk/models/components/gettaxratesresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetTaxRatesResponse - TaxRates -type GetTaxRatesResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []TaxRate `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetTaxRatesResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetTaxRatesResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetTaxRatesResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetTaxRatesResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetTaxRatesResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetTaxRatesResponse) GetData() []TaxRate { - if o == nil { - return []TaxRate{} - } - return o.Data -} - -func (o *GetTaxRatesResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetTaxRatesResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetTaxRatesResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getticketresponse.go b/tests/mockserver/internal/sdk/models/components/getticketresponse.go deleted file mode 100644 index 536c0ac0..00000000 --- a/tests/mockserver/internal/sdk/models/components/getticketresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetTicketResponse - Get a Ticket -type GetTicketResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data Ticket `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetTicketResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetTicketResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetTicketResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetTicketResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetTicketResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetTicketResponse) GetData() Ticket { - if o == nil { - return Ticket{} - } - return o.Data -} - -func (o *GetTicketResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getticketsresponse.go b/tests/mockserver/internal/sdk/models/components/getticketsresponse.go deleted file mode 100644 index bd6008d9..00000000 --- a/tests/mockserver/internal/sdk/models/components/getticketsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetTicketsResponse - List Tickets -type GetTicketsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []Ticket `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetTicketsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetTicketsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetTicketsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetTicketsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetTicketsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetTicketsResponse) GetData() []Ticket { - if o == nil { - return []Ticket{} - } - return o.Data -} - -func (o *GetTicketsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetTicketsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetTicketsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/gettimeoffrequestresponse.go b/tests/mockserver/internal/sdk/models/components/gettimeoffrequestresponse.go deleted file mode 100644 index 448e7928..00000000 --- a/tests/mockserver/internal/sdk/models/components/gettimeoffrequestresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetTimeOffRequestResponse - TimeOffRequests -type GetTimeOffRequestResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data TimeOffRequest `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetTimeOffRequestResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetTimeOffRequestResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetTimeOffRequestResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetTimeOffRequestResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetTimeOffRequestResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetTimeOffRequestResponse) GetData() TimeOffRequest { - if o == nil { - return TimeOffRequest{} - } - return o.Data -} - -func (o *GetTimeOffRequestResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/gettimeoffrequestsresponse.go b/tests/mockserver/internal/sdk/models/components/gettimeoffrequestsresponse.go deleted file mode 100644 index 3c3754dc..00000000 --- a/tests/mockserver/internal/sdk/models/components/gettimeoffrequestsresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetTimeOffRequestsResponse - TimeOffRequests -type GetTimeOffRequestsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []TimeOffRequest `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetTimeOffRequestsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetTimeOffRequestsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetTimeOffRequestsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetTimeOffRequestsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetTimeOffRequestsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetTimeOffRequestsResponse) GetData() []TimeOffRequest { - if o == nil { - return []TimeOffRequest{} - } - return o.Data -} - -func (o *GetTimeOffRequestsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetTimeOffRequestsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetTimeOffRequestsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/gettrackingcategoriesresponse.go b/tests/mockserver/internal/sdk/models/components/gettrackingcategoriesresponse.go deleted file mode 100644 index d8dc30fe..00000000 --- a/tests/mockserver/internal/sdk/models/components/gettrackingcategoriesresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetTrackingCategoriesResponse - Tracking categories -type GetTrackingCategoriesResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []TrackingCategory `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetTrackingCategoriesResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetTrackingCategoriesResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetTrackingCategoriesResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetTrackingCategoriesResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetTrackingCategoriesResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetTrackingCategoriesResponse) GetData() []TrackingCategory { - if o == nil { - return []TrackingCategory{} - } - return o.Data -} - -func (o *GetTrackingCategoriesResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetTrackingCategoriesResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetTrackingCategoriesResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/gettrackingcategoryresponse.go b/tests/mockserver/internal/sdk/models/components/gettrackingcategoryresponse.go deleted file mode 100644 index e67edb51..00000000 --- a/tests/mockserver/internal/sdk/models/components/gettrackingcategoryresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetTrackingCategoryResponse - Tracking category -type GetTrackingCategoryResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data TrackingCategory `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetTrackingCategoryResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetTrackingCategoryResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetTrackingCategoryResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetTrackingCategoryResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetTrackingCategoryResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetTrackingCategoryResponse) GetData() TrackingCategory { - if o == nil { - return TrackingCategory{} - } - return o.Data -} - -func (o *GetTrackingCategoryResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getuploadsessionresponse.go b/tests/mockserver/internal/sdk/models/components/getuploadsessionresponse.go deleted file mode 100644 index fc21d938..00000000 --- a/tests/mockserver/internal/sdk/models/components/getuploadsessionresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetUploadSessionResponse - UploadSessions -type GetUploadSessionResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data UploadSession `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetUploadSessionResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetUploadSessionResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetUploadSessionResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetUploadSessionResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetUploadSessionResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetUploadSessionResponse) GetData() UploadSession { - if o == nil { - return UploadSession{} - } - return o.Data -} - -func (o *GetUploadSessionResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getuserresponse.go b/tests/mockserver/internal/sdk/models/components/getuserresponse.go deleted file mode 100644 index e203c9bb..00000000 --- a/tests/mockserver/internal/sdk/models/components/getuserresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetUserResponse - User -type GetUserResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data UserOutput `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetUserResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetUserResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetUserResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetUserResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetUserResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetUserResponse) GetData() UserOutput { - if o == nil { - return UserOutput{} - } - return o.Data -} - -func (o *GetUserResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getusersresponse.go b/tests/mockserver/internal/sdk/models/components/getusersresponse.go deleted file mode 100644 index 88685743..00000000 --- a/tests/mockserver/internal/sdk/models/components/getusersresponse.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetUsersResponse - Users -type GetUsersResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data []UserOutput `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` - // 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 *GetUsersResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetUsersResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetUsersResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *GetUsersResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *GetUsersResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *GetUsersResponse) GetData() []UserOutput { - if o == nil { - return []UserOutput{} - } - return o.Data -} - -func (o *GetUsersResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} - -func (o *GetUsersResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetUsersResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} diff --git a/tests/mockserver/internal/sdk/models/components/getwebhookeventlogsresponse.go b/tests/mockserver/internal/sdk/models/components/getwebhookeventlogsresponse.go deleted file mode 100644 index 4c5651f2..00000000 --- a/tests/mockserver/internal/sdk/models/components/getwebhookeventlogsresponse.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetWebhookEventLogsResponse - EventLogs -type GetWebhookEventLogsResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data []WebhookEventLog `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetWebhookEventLogsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetWebhookEventLogsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetWebhookEventLogsResponse) GetData() []WebhookEventLog { - if o == nil { - return []WebhookEventLog{} - } - return o.Data -} - -func (o *GetWebhookEventLogsResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetWebhookEventLogsResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetWebhookEventLogsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getwebhookresponse.go b/tests/mockserver/internal/sdk/models/components/getwebhookresponse.go deleted file mode 100644 index b6ff77dd..00000000 --- a/tests/mockserver/internal/sdk/models/components/getwebhookresponse.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetWebhookResponse - Webhooks -type GetWebhookResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data Webhook `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetWebhookResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetWebhookResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetWebhookResponse) GetData() Webhook { - if o == nil { - return Webhook{} - } - return o.Data -} - -func (o *GetWebhookResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/getwebhooksresponse.go b/tests/mockserver/internal/sdk/models/components/getwebhooksresponse.go deleted file mode 100644 index 680d5245..00000000 --- a/tests/mockserver/internal/sdk/models/components/getwebhooksresponse.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetWebhooksResponse - Webhooks -type GetWebhooksResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data []Webhook `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"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *GetWebhooksResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *GetWebhooksResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *GetWebhooksResponse) GetData() []Webhook { - if o == nil { - return []Webhook{} - } - return o.Data -} - -func (o *GetWebhooksResponse) GetMeta() *Meta { - if o == nil { - return nil - } - return o.Meta -} - -func (o *GetWebhooksResponse) GetLinks() *Links { - if o == nil { - return nil - } - return o.Links -} - -func (o *GetWebhooksResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/hriscompany.go b/tests/mockserver/internal/sdk/models/components/hriscompany.go deleted file mode 100644 index 8f8ea25c..00000000 --- a/tests/mockserver/internal/sdk/models/components/hriscompany.go +++ /dev/null @@ -1,319 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -type HrisCompanyStatus string - -const ( - HrisCompanyStatusActive HrisCompanyStatus = "active" - HrisCompanyStatusInactive HrisCompanyStatus = "inactive" - HrisCompanyStatusTrial HrisCompanyStatus = "trial" - HrisCompanyStatusOther HrisCompanyStatus = "other" -) - -func (e HrisCompanyStatus) ToPointer() *HrisCompanyStatus { - return &e -} -func (e *HrisCompanyStatus) 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 "trial": - fallthrough - case "other": - *e = HrisCompanyStatus(v) - return nil - default: - return fmt.Errorf("invalid value for HrisCompanyStatus: %v", v) - } -} - -type HrisCompany struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - LegalName *string `json:"legal_name"` - DisplayName *string `json:"display_name,omitempty"` - Subdomain *string `json:"subdomain,omitempty"` - Status *HrisCompanyStatus `json:"status,omitempty"` - // An Company Number, Company ID or Company Code, is a unique number that has been assigned to each company. - CompanyNumber *string `json:"company_number,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"` - Addresses []Address `json:"addresses,omitempty"` - PhoneNumbers []PhoneNumber `json:"phone_numbers,omitempty"` - Emails []Email `json:"emails,omitempty"` - Websites []Website `json:"websites,omitempty"` - DebtorID *string `json:"debtor_id,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - Deleted *bool `json:"deleted,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (h HrisCompany) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisCompany) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisCompany) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *HrisCompany) GetLegalName() *string { - if o == nil { - return nil - } - return o.LegalName -} - -func (o *HrisCompany) GetDisplayName() *string { - if o == nil { - return nil - } - return o.DisplayName -} - -func (o *HrisCompany) GetSubdomain() *string { - if o == nil { - return nil - } - return o.Subdomain -} - -func (o *HrisCompany) GetStatus() *HrisCompanyStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *HrisCompany) GetCompanyNumber() *string { - if o == nil { - return nil - } - return o.CompanyNumber -} - -func (o *HrisCompany) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *HrisCompany) GetAddresses() []Address { - if o == nil { - return nil - } - return o.Addresses -} - -func (o *HrisCompany) GetPhoneNumbers() []PhoneNumber { - if o == nil { - return nil - } - return o.PhoneNumbers -} - -func (o *HrisCompany) GetEmails() []Email { - if o == nil { - return nil - } - return o.Emails -} - -func (o *HrisCompany) GetWebsites() []Website { - if o == nil { - return nil - } - return o.Websites -} - -func (o *HrisCompany) GetDebtorID() *string { - if o == nil { - return nil - } - return o.DebtorID -} - -func (o *HrisCompany) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *HrisCompany) GetDeleted() *bool { - if o == nil { - return nil - } - return o.Deleted -} - -func (o *HrisCompany) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *HrisCompany) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *HrisCompany) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *HrisCompany) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *HrisCompany) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type HrisCompanyInput struct { - LegalName *string `json:"legal_name"` - DisplayName *string `json:"display_name,omitempty"` - Subdomain *string `json:"subdomain,omitempty"` - Status *HrisCompanyStatus `json:"status,omitempty"` - // An Company Number, Company ID or Company Code, is a unique number that has been assigned to each company. - CompanyNumber *string `json:"company_number,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"` - Addresses []Address `json:"addresses,omitempty"` - PhoneNumbers []PhoneNumber `json:"phone_numbers,omitempty"` - Emails []Email `json:"emails,omitempty"` - Websites []Website `json:"websites,omitempty"` - DebtorID *string `json:"debtor_id,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *HrisCompanyInput) GetLegalName() *string { - if o == nil { - return nil - } - return o.LegalName -} - -func (o *HrisCompanyInput) GetDisplayName() *string { - if o == nil { - return nil - } - return o.DisplayName -} - -func (o *HrisCompanyInput) GetSubdomain() *string { - if o == nil { - return nil - } - return o.Subdomain -} - -func (o *HrisCompanyInput) GetStatus() *HrisCompanyStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *HrisCompanyInput) GetCompanyNumber() *string { - if o == nil { - return nil - } - return o.CompanyNumber -} - -func (o *HrisCompanyInput) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *HrisCompanyInput) GetAddresses() []Address { - if o == nil { - return nil - } - return o.Addresses -} - -func (o *HrisCompanyInput) GetPhoneNumbers() []PhoneNumber { - if o == nil { - return nil - } - return o.PhoneNumbers -} - -func (o *HrisCompanyInput) GetEmails() []Email { - if o == nil { - return nil - } - return o.Emails -} - -func (o *HrisCompanyInput) GetWebsites() []Website { - if o == nil { - return nil - } - return o.Websites -} - -func (o *HrisCompanyInput) GetDebtorID() *string { - if o == nil { - return nil - } - return o.DebtorID -} - -func (o *HrisCompanyInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/httpmetadata.go b/tests/mockserver/internal/sdk/models/components/httpmetadata.go deleted file mode 100644 index e18bdc06..00000000 --- a/tests/mockserver/internal/sdk/models/components/httpmetadata.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "net/http" -) - -type HTTPMetadata struct { - // Raw HTTP response; suitable for custom response parsing - Response *http.Response `json:"-"` - // Raw HTTP request; suitable for debugging - Request *http.Request `json:"-"` -} - -func (o *HTTPMetadata) GetResponse() *http.Response { - if o == nil { - return nil - } - return o.Response -} - -func (o *HTTPMetadata) GetRequest() *http.Request { - if o == nil { - return nil - } - return o.Request -} diff --git a/tests/mockserver/internal/sdk/models/components/integrationstate.go b/tests/mockserver/internal/sdk/models/components/integrationstate.go deleted file mode 100644 index 11fa8bb2..00000000 --- a/tests/mockserver/internal/sdk/models/components/integrationstate.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// IntegrationState - The current state of the Integration. -type IntegrationState string - -const ( - IntegrationStateDisabled IntegrationState = "disabled" - IntegrationStateNeedsConfiguration IntegrationState = "needs_configuration" - IntegrationStateConfigured IntegrationState = "configured" -) - -func (e IntegrationState) ToPointer() *IntegrationState { - return &e -} -func (e *IntegrationState) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "disabled": - fallthrough - case "needs_configuration": - fallthrough - case "configured": - *e = IntegrationState(v) - return nil - default: - return fmt.Errorf("invalid value for IntegrationState: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/invoice.go b/tests/mockserver/internal/sdk/models/components/invoice.go deleted file mode 100644 index c1b74d5e..00000000 --- a/tests/mockserver/internal/sdk/models/components/invoice.go +++ /dev/null @@ -1,935 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/types" - "mockserver/internal/sdk/utils" - "time" -) - -// InvoiceType - Invoice type -type InvoiceType string - -const ( - InvoiceTypeStandard InvoiceType = "standard" - InvoiceTypeCredit InvoiceType = "credit" - InvoiceTypeService InvoiceType = "service" - InvoiceTypeProduct InvoiceType = "product" - InvoiceTypeSupplier InvoiceType = "supplier" - InvoiceTypeOther InvoiceType = "other" -) - -func (e InvoiceType) ToPointer() *InvoiceType { - return &e -} -func (e *InvoiceType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "standard": - fallthrough - case "credit": - fallthrough - case "service": - fallthrough - case "product": - fallthrough - case "supplier": - fallthrough - case "other": - *e = InvoiceType(v) - return nil - default: - return fmt.Errorf("invalid value for InvoiceType: %v", v) - } -} - -// InvoiceStatus - Invoice status -type InvoiceStatus string - -const ( - InvoiceStatusDraft InvoiceStatus = "draft" - InvoiceStatusSubmitted InvoiceStatus = "submitted" - InvoiceStatusAuthorised InvoiceStatus = "authorised" - InvoiceStatusPartiallyPaid InvoiceStatus = "partially_paid" - InvoiceStatusPaid InvoiceStatus = "paid" - InvoiceStatusVoid InvoiceStatus = "void" - InvoiceStatusCredit InvoiceStatus = "credit" - InvoiceStatusDeleted InvoiceStatus = "deleted" -) - -func (e InvoiceStatus) ToPointer() *InvoiceStatus { - return &e -} -func (e *InvoiceStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "draft": - fallthrough - case "submitted": - fallthrough - case "authorised": - fallthrough - case "partially_paid": - fallthrough - case "paid": - fallthrough - case "void": - fallthrough - case "credit": - fallthrough - case "deleted": - *e = InvoiceStatus(v) - return nil - default: - return fmt.Errorf("invalid value for InvoiceStatus: %v", v) - } -} - -type PaymentAllocation struct { - // ID of the payment - ID *string `json:"id,omitempty"` - // Amount of the payment allocated to the invoice - AllocatedAmount *float64 `json:"allocated_amount,omitempty"` - // Date of the payment - Date *time.Time `json:"date,omitempty"` -} - -func (p PaymentAllocation) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *PaymentAllocation) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { - return err - } - return nil -} - -func (o *PaymentAllocation) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *PaymentAllocation) GetAllocatedAmount() *float64 { - if o == nil { - return nil - } - return o.AllocatedAmount -} - -func (o *PaymentAllocation) GetDate() *time.Time { - if o == nil { - return nil - } - return o.Date -} - -type Invoice struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The third-party API ID of original entity - DownstreamID *string `json:"downstream_id,omitempty"` - // Invoice type - Type *InvoiceType `json:"type,omitempty"` - // Invoice number. - Number *string `json:"number,omitempty"` - // The customer this entity is linked to. - Customer *LinkedCustomer `json:"customer,omitempty"` - // The company or subsidiary id the transaction belongs to - CompanyID *string `json:"company_id,omitempty"` - // Date invoice was issued - YYYY-MM-DD. - InvoiceDate *types.Date `json:"invoice_date,omitempty"` - // The invoice due date is the date on which a payment or invoice is scheduled to be received by the seller - YYYY-MM-DD. - DueDate *types.Date `json:"due_date,omitempty"` - // Terms of payment. - Terms *string `json:"terms,omitempty"` - // A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. - PoNumber *string `json:"po_number,omitempty"` - // Optional reference identifier for the transaction. - Reference *string `json:"reference,omitempty"` - // Invoice status - Status *InvoiceStatus `json:"status,omitempty"` - // Invoice sent to contact/customer. - InvoiceSent *bool `json:"invoice_sent,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"` - // Currency Exchange Rate at the time entity was recorded/generated. - CurrencyRate *float64 `json:"currency_rate,omitempty"` - // Amounts are including tax - TaxInclusive *bool `json:"tax_inclusive,omitempty"` - // Sub-total amount, normally before tax. - SubTotal *float64 `json:"sub_total,omitempty"` - // Total tax amount applied to this invoice. - TotalTax *float64 `json:"total_tax,omitempty"` - // Applicable tax id/code override if tax is not supplied on a line item basis. - TaxCode *string `json:"tax_code,omitempty"` - // Discount percentage applied to this invoice. - DiscountPercentage *float64 `json:"discount_percentage,omitempty"` - // Discount amount applied to this invoice. - DiscountAmount *float64 `json:"discount_amount,omitempty"` - // Total amount of invoice, including tax. - Total *float64 `json:"total,omitempty"` - // Balance of invoice due. - Balance *float64 `json:"balance,omitempty"` - // Amount of deposit made to this invoice. - Deposit *float64 `json:"deposit,omitempty"` - // Customer memo - CustomerMemo *string `json:"customer_memo,omitempty"` - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - TrackingCategory *DeprecatedLinkedTrackingCategory `json:"tracking_category,omitempty"` - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - LineItems []InvoiceLineItem `json:"line_items,omitempty"` - BillingAddress *Address `json:"billing_address,omitempty"` - ShippingAddress *Address `json:"shipping_address,omitempty"` - // Optional invoice template - TemplateID *string `json:"template_id,omitempty"` - // URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. - SourceDocumentURL *string `json:"source_document_url,omitempty"` - // IDs of payments made on the invoice - PaymentAllocations []PaymentAllocation `json:"payment_allocations,omitempty"` - // Payment method used for the transaction, such as cash, credit card, bank transfer, or check - PaymentMethod *string `json:"payment_method,omitempty"` - // The channel through which the transaction is processed. - Channel *string `json:"channel,omitempty"` - // language code according to ISO 639-1. For the United States - EN - Language *string `json:"language,omitempty"` - // Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. - AccountingByRow *bool `json:"accounting_by_row,omitempty"` - BankAccount *BankAccount `json:"bank_account,omitempty"` - LedgerAccount *LinkedLedgerAccount `json:"ledger_account,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (i Invoice) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *Invoice) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Invoice) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Invoice) GetDownstreamID() *string { - if o == nil { - return nil - } - return o.DownstreamID -} - -func (o *Invoice) GetType() *InvoiceType { - if o == nil { - return nil - } - return o.Type -} - -func (o *Invoice) GetNumber() *string { - if o == nil { - return nil - } - return o.Number -} - -func (o *Invoice) GetCustomer() *LinkedCustomer { - if o == nil { - return nil - } - return o.Customer -} - -func (o *Invoice) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *Invoice) GetInvoiceDate() *types.Date { - if o == nil { - return nil - } - return o.InvoiceDate -} - -func (o *Invoice) GetDueDate() *types.Date { - if o == nil { - return nil - } - return o.DueDate -} - -func (o *Invoice) GetTerms() *string { - if o == nil { - return nil - } - return o.Terms -} - -func (o *Invoice) GetPoNumber() *string { - if o == nil { - return nil - } - return o.PoNumber -} - -func (o *Invoice) GetReference() *string { - if o == nil { - return nil - } - return o.Reference -} - -func (o *Invoice) GetStatus() *InvoiceStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *Invoice) GetInvoiceSent() *bool { - if o == nil { - return nil - } - return o.InvoiceSent -} - -func (o *Invoice) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *Invoice) GetCurrencyRate() *float64 { - if o == nil { - return nil - } - return o.CurrencyRate -} - -func (o *Invoice) GetTaxInclusive() *bool { - if o == nil { - return nil - } - return o.TaxInclusive -} - -func (o *Invoice) GetSubTotal() *float64 { - if o == nil { - return nil - } - return o.SubTotal -} - -func (o *Invoice) GetTotalTax() *float64 { - if o == nil { - return nil - } - return o.TotalTax -} - -func (o *Invoice) GetTaxCode() *string { - if o == nil { - return nil - } - return o.TaxCode -} - -func (o *Invoice) GetDiscountPercentage() *float64 { - if o == nil { - return nil - } - return o.DiscountPercentage -} - -func (o *Invoice) GetDiscountAmount() *float64 { - if o == nil { - return nil - } - return o.DiscountAmount -} - -func (o *Invoice) GetTotal() *float64 { - if o == nil { - return nil - } - return o.Total -} - -func (o *Invoice) GetBalance() *float64 { - if o == nil { - return nil - } - return o.Balance -} - -func (o *Invoice) GetDeposit() *float64 { - if o == nil { - return nil - } - return o.Deposit -} - -func (o *Invoice) GetCustomerMemo() *string { - if o == nil { - return nil - } - return o.CustomerMemo -} - -func (o *Invoice) GetTrackingCategory() *DeprecatedLinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategory -} - -func (o *Invoice) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *Invoice) GetLineItems() []InvoiceLineItem { - if o == nil { - return nil - } - return o.LineItems -} - -func (o *Invoice) GetBillingAddress() *Address { - if o == nil { - return nil - } - return o.BillingAddress -} - -func (o *Invoice) GetShippingAddress() *Address { - if o == nil { - return nil - } - return o.ShippingAddress -} - -func (o *Invoice) GetTemplateID() *string { - if o == nil { - return nil - } - return o.TemplateID -} - -func (o *Invoice) GetSourceDocumentURL() *string { - if o == nil { - return nil - } - return o.SourceDocumentURL -} - -func (o *Invoice) GetPaymentAllocations() []PaymentAllocation { - if o == nil { - return nil - } - return o.PaymentAllocations -} - -func (o *Invoice) GetPaymentMethod() *string { - if o == nil { - return nil - } - return o.PaymentMethod -} - -func (o *Invoice) GetChannel() *string { - if o == nil { - return nil - } - return o.Channel -} - -func (o *Invoice) GetLanguage() *string { - if o == nil { - return nil - } - return o.Language -} - -func (o *Invoice) GetAccountingByRow() *bool { - if o == nil { - return nil - } - return o.AccountingByRow -} - -func (o *Invoice) GetBankAccount() *BankAccount { - if o == nil { - return nil - } - return o.BankAccount -} - -func (o *Invoice) GetLedgerAccount() *LinkedLedgerAccount { - if o == nil { - return nil - } - return o.LedgerAccount -} - -func (o *Invoice) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Invoice) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *Invoice) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *Invoice) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *Invoice) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *Invoice) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Invoice) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Invoice) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type InvoiceInput struct { - // Invoice type - Type *InvoiceType `json:"type,omitempty"` - // Invoice number. - Number *string `json:"number,omitempty"` - // The customer this entity is linked to. - Customer *LinkedCustomerInput `json:"customer,omitempty"` - // The company or subsidiary id the transaction belongs to - CompanyID *string `json:"company_id,omitempty"` - // Date invoice was issued - YYYY-MM-DD. - InvoiceDate *types.Date `json:"invoice_date,omitempty"` - // The invoice due date is the date on which a payment or invoice is scheduled to be received by the seller - YYYY-MM-DD. - DueDate *types.Date `json:"due_date,omitempty"` - // Terms of payment. - Terms *string `json:"terms,omitempty"` - // A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. - PoNumber *string `json:"po_number,omitempty"` - // Optional reference identifier for the transaction. - Reference *string `json:"reference,omitempty"` - // Invoice status - Status *InvoiceStatus `json:"status,omitempty"` - // Invoice sent to contact/customer. - InvoiceSent *bool `json:"invoice_sent,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"` - // Currency Exchange Rate at the time entity was recorded/generated. - CurrencyRate *float64 `json:"currency_rate,omitempty"` - // Amounts are including tax - TaxInclusive *bool `json:"tax_inclusive,omitempty"` - // Sub-total amount, normally before tax. - SubTotal *float64 `json:"sub_total,omitempty"` - // Total tax amount applied to this invoice. - TotalTax *float64 `json:"total_tax,omitempty"` - // Applicable tax id/code override if tax is not supplied on a line item basis. - TaxCode *string `json:"tax_code,omitempty"` - // Discount percentage applied to this invoice. - DiscountPercentage *float64 `json:"discount_percentage,omitempty"` - // Discount amount applied to this invoice. - DiscountAmount *float64 `json:"discount_amount,omitempty"` - // Total amount of invoice, including tax. - Total *float64 `json:"total,omitempty"` - // Balance of invoice due. - Balance *float64 `json:"balance,omitempty"` - // Amount of deposit made to this invoice. - Deposit *float64 `json:"deposit,omitempty"` - // Customer memo - CustomerMemo *string `json:"customer_memo,omitempty"` - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - TrackingCategory *DeprecatedLinkedTrackingCategory `json:"tracking_category,omitempty"` - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - LineItems []InvoiceLineItemInput `json:"line_items,omitempty"` - BillingAddress *Address `json:"billing_address,omitempty"` - ShippingAddress *Address `json:"shipping_address,omitempty"` - // Optional invoice template - TemplateID *string `json:"template_id,omitempty"` - // URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. - SourceDocumentURL *string `json:"source_document_url,omitempty"` - // IDs of payments made on the invoice - PaymentAllocations []PaymentAllocation `json:"payment_allocations,omitempty"` - // Payment method used for the transaction, such as cash, credit card, bank transfer, or check - PaymentMethod *string `json:"payment_method,omitempty"` - // The channel through which the transaction is processed. - Channel *string `json:"channel,omitempty"` - // language code according to ISO 639-1. For the United States - EN - Language *string `json:"language,omitempty"` - // Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. - AccountingByRow *bool `json:"accounting_by_row,omitempty"` - BankAccount *BankAccount `json:"bank_account,omitempty"` - LedgerAccount *LinkedLedgerAccountInput `json:"ledger_account,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (i InvoiceInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *InvoiceInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *InvoiceInput) GetType() *InvoiceType { - if o == nil { - return nil - } - return o.Type -} - -func (o *InvoiceInput) GetNumber() *string { - if o == nil { - return nil - } - return o.Number -} - -func (o *InvoiceInput) GetCustomer() *LinkedCustomerInput { - if o == nil { - return nil - } - return o.Customer -} - -func (o *InvoiceInput) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *InvoiceInput) GetInvoiceDate() *types.Date { - if o == nil { - return nil - } - return o.InvoiceDate -} - -func (o *InvoiceInput) GetDueDate() *types.Date { - if o == nil { - return nil - } - return o.DueDate -} - -func (o *InvoiceInput) GetTerms() *string { - if o == nil { - return nil - } - return o.Terms -} - -func (o *InvoiceInput) GetPoNumber() *string { - if o == nil { - return nil - } - return o.PoNumber -} - -func (o *InvoiceInput) GetReference() *string { - if o == nil { - return nil - } - return o.Reference -} - -func (o *InvoiceInput) GetStatus() *InvoiceStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *InvoiceInput) GetInvoiceSent() *bool { - if o == nil { - return nil - } - return o.InvoiceSent -} - -func (o *InvoiceInput) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *InvoiceInput) GetCurrencyRate() *float64 { - if o == nil { - return nil - } - return o.CurrencyRate -} - -func (o *InvoiceInput) GetTaxInclusive() *bool { - if o == nil { - return nil - } - return o.TaxInclusive -} - -func (o *InvoiceInput) GetSubTotal() *float64 { - if o == nil { - return nil - } - return o.SubTotal -} - -func (o *InvoiceInput) GetTotalTax() *float64 { - if o == nil { - return nil - } - return o.TotalTax -} - -func (o *InvoiceInput) GetTaxCode() *string { - if o == nil { - return nil - } - return o.TaxCode -} - -func (o *InvoiceInput) GetDiscountPercentage() *float64 { - if o == nil { - return nil - } - return o.DiscountPercentage -} - -func (o *InvoiceInput) GetDiscountAmount() *float64 { - if o == nil { - return nil - } - return o.DiscountAmount -} - -func (o *InvoiceInput) GetTotal() *float64 { - if o == nil { - return nil - } - return o.Total -} - -func (o *InvoiceInput) GetBalance() *float64 { - if o == nil { - return nil - } - return o.Balance -} - -func (o *InvoiceInput) GetDeposit() *float64 { - if o == nil { - return nil - } - return o.Deposit -} - -func (o *InvoiceInput) GetCustomerMemo() *string { - if o == nil { - return nil - } - return o.CustomerMemo -} - -func (o *InvoiceInput) GetTrackingCategory() *DeprecatedLinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategory -} - -func (o *InvoiceInput) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *InvoiceInput) GetLineItems() []InvoiceLineItemInput { - if o == nil { - return nil - } - return o.LineItems -} - -func (o *InvoiceInput) GetBillingAddress() *Address { - if o == nil { - return nil - } - return o.BillingAddress -} - -func (o *InvoiceInput) GetShippingAddress() *Address { - if o == nil { - return nil - } - return o.ShippingAddress -} - -func (o *InvoiceInput) GetTemplateID() *string { - if o == nil { - return nil - } - return o.TemplateID -} - -func (o *InvoiceInput) GetSourceDocumentURL() *string { - if o == nil { - return nil - } - return o.SourceDocumentURL -} - -func (o *InvoiceInput) GetPaymentAllocations() []PaymentAllocation { - if o == nil { - return nil - } - return o.PaymentAllocations -} - -func (o *InvoiceInput) GetPaymentMethod() *string { - if o == nil { - return nil - } - return o.PaymentMethod -} - -func (o *InvoiceInput) GetChannel() *string { - if o == nil { - return nil - } - return o.Channel -} - -func (o *InvoiceInput) GetLanguage() *string { - if o == nil { - return nil - } - return o.Language -} - -func (o *InvoiceInput) GetAccountingByRow() *bool { - if o == nil { - return nil - } - return o.AccountingByRow -} - -func (o *InvoiceInput) GetBankAccount() *BankAccount { - if o == nil { - return nil - } - return o.BankAccount -} - -func (o *InvoiceInput) GetLedgerAccount() *LinkedLedgerAccountInput { - if o == nil { - return nil - } - return o.LedgerAccount -} - -func (o *InvoiceInput) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *InvoiceInput) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *InvoiceInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/invoiceitem.go b/tests/mockserver/internal/sdk/models/components/invoiceitem.go deleted file mode 100644 index 82ba3556..00000000 --- a/tests/mockserver/internal/sdk/models/components/invoiceitem.go +++ /dev/null @@ -1,711 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/types" - "mockserver/internal/sdk/utils" - "time" -) - -// InvoiceItemType - Item type -type InvoiceItemType string - -const ( - InvoiceItemTypeInventory InvoiceItemType = "inventory" - InvoiceItemTypeNonInventory InvoiceItemType = "non_inventory" - InvoiceItemTypeService InvoiceItemType = "service" - InvoiceItemTypeDescription InvoiceItemType = "description" - InvoiceItemTypeOther InvoiceItemType = "other" -) - -func (e InvoiceItemType) ToPointer() *InvoiceItemType { - return &e -} -func (e *InvoiceItemType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "inventory": - fallthrough - case "non_inventory": - fallthrough - case "service": - fallthrough - case "description": - fallthrough - case "other": - *e = InvoiceItemType(v) - return nil - default: - return fmt.Errorf("invalid value for InvoiceItemType: %v", v) - } -} - -type SalesDetails struct { - UnitPrice *float64 `json:"unit_price,omitempty"` - // Description of the unit type the item is sold as, ie: kg, hour. - UnitOfMeasure *string `json:"unit_of_measure,omitempty"` - // Amounts are including tax - TaxInclusive *bool `json:"tax_inclusive,omitempty"` - TaxRate *LinkedTaxRate `json:"tax_rate,omitempty"` -} - -func (o *SalesDetails) GetUnitPrice() *float64 { - if o == nil { - return nil - } - return o.UnitPrice -} - -func (o *SalesDetails) GetUnitOfMeasure() *string { - if o == nil { - return nil - } - return o.UnitOfMeasure -} - -func (o *SalesDetails) GetTaxInclusive() *bool { - if o == nil { - return nil - } - return o.TaxInclusive -} - -func (o *SalesDetails) GetTaxRate() *LinkedTaxRate { - if o == nil { - return nil - } - return o.TaxRate -} - -type PurchaseDetails struct { - UnitPrice *float64 `json:"unit_price,omitempty"` - // Description of the unit type the item is sold as, ie: kg, hour. - UnitOfMeasure *string `json:"unit_of_measure,omitempty"` - // Amounts are including tax - TaxInclusive *bool `json:"tax_inclusive,omitempty"` - TaxRate *LinkedTaxRate `json:"tax_rate,omitempty"` -} - -func (o *PurchaseDetails) GetUnitPrice() *float64 { - if o == nil { - return nil - } - return o.UnitPrice -} - -func (o *PurchaseDetails) GetUnitOfMeasure() *string { - if o == nil { - return nil - } - return o.UnitOfMeasure -} - -func (o *PurchaseDetails) GetTaxInclusive() *bool { - if o == nil { - return nil - } - return o.TaxInclusive -} - -func (o *PurchaseDetails) GetTaxRate() *LinkedTaxRate { - if o == nil { - return nil - } - return o.TaxRate -} - -type InvoiceItem struct { - // The ID of the item. - ID *string `json:"id,omitempty"` - // Item name - Name *string `json:"name,omitempty"` - // A short description of the item - Description *string `json:"description,omitempty"` - // User defined item code - Code *string `json:"code,omitempty"` - // Item will be available on sales transactions - Sold *bool `json:"sold,omitempty"` - // Item is available for purchase transactions - Purchased *bool `json:"purchased,omitempty"` - // Item is inventoried - Tracked *bool `json:"tracked,omitempty"` - // If true, transactions for this item are taxable - Taxable *bool `json:"taxable,omitempty"` - // The date of opening balance if inventory item is tracked - YYYY-MM-DD. - InventoryDate *types.Date `json:"inventory_date,omitempty"` - // Item type - Type *InvoiceItemType `json:"type,omitempty"` - SalesDetails *SalesDetails `json:"sales_details,omitempty"` - PurchaseDetails *PurchaseDetails `json:"purchase_details,omitempty"` - Quantity *float64 `json:"quantity,omitempty"` - UnitPrice *float64 `json:"unit_price,omitempty"` - AssetAccount *LinkedLedgerAccount `json:"asset_account,omitempty"` - IncomeAccount *LinkedLedgerAccount `json:"income_account,omitempty"` - ExpenseAccount *LinkedLedgerAccount `json:"expense_account,omitempty"` - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - TrackingCategory *DeprecatedLinkedTrackingCategory `json:"tracking_category,omitempty"` - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - Active *bool `json:"active,omitempty"` - // The ID of the department - DepartmentID *string `json:"department_id,omitempty"` - // The ID of the location - LocationID *string `json:"location_id,omitempty"` - // The ID of the subsidiary - SubsidiaryID *string `json:"subsidiary_id,omitempty"` - // The ID of the tax schedule - TaxScheduleID *string `json:"tax_schedule_id,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (i InvoiceItem) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *InvoiceItem) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *InvoiceItem) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *InvoiceItem) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *InvoiceItem) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *InvoiceItem) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *InvoiceItem) GetSold() *bool { - if o == nil { - return nil - } - return o.Sold -} - -func (o *InvoiceItem) GetPurchased() *bool { - if o == nil { - return nil - } - return o.Purchased -} - -func (o *InvoiceItem) GetTracked() *bool { - if o == nil { - return nil - } - return o.Tracked -} - -func (o *InvoiceItem) GetTaxable() *bool { - if o == nil { - return nil - } - return o.Taxable -} - -func (o *InvoiceItem) GetInventoryDate() *types.Date { - if o == nil { - return nil - } - return o.InventoryDate -} - -func (o *InvoiceItem) GetType() *InvoiceItemType { - if o == nil { - return nil - } - return o.Type -} - -func (o *InvoiceItem) GetSalesDetails() *SalesDetails { - if o == nil { - return nil - } - return o.SalesDetails -} - -func (o *InvoiceItem) GetPurchaseDetails() *PurchaseDetails { - if o == nil { - return nil - } - return o.PurchaseDetails -} - -func (o *InvoiceItem) GetQuantity() *float64 { - if o == nil { - return nil - } - return o.Quantity -} - -func (o *InvoiceItem) GetUnitPrice() *float64 { - if o == nil { - return nil - } - return o.UnitPrice -} - -func (o *InvoiceItem) GetAssetAccount() *LinkedLedgerAccount { - if o == nil { - return nil - } - return o.AssetAccount -} - -func (o *InvoiceItem) GetIncomeAccount() *LinkedLedgerAccount { - if o == nil { - return nil - } - return o.IncomeAccount -} - -func (o *InvoiceItem) GetExpenseAccount() *LinkedLedgerAccount { - if o == nil { - return nil - } - return o.ExpenseAccount -} - -func (o *InvoiceItem) GetTrackingCategory() *DeprecatedLinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategory -} - -func (o *InvoiceItem) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *InvoiceItem) GetActive() *bool { - if o == nil { - return nil - } - return o.Active -} - -func (o *InvoiceItem) GetDepartmentID() *string { - if o == nil { - return nil - } - return o.DepartmentID -} - -func (o *InvoiceItem) GetLocationID() *string { - if o == nil { - return nil - } - return o.LocationID -} - -func (o *InvoiceItem) GetSubsidiaryID() *string { - if o == nil { - return nil - } - return o.SubsidiaryID -} - -func (o *InvoiceItem) GetTaxScheduleID() *string { - if o == nil { - return nil - } - return o.TaxScheduleID -} - -func (o *InvoiceItem) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *InvoiceItem) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *InvoiceItem) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *InvoiceItem) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *InvoiceItem) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *InvoiceItem) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *InvoiceItem) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type SalesDetailsInput struct { - UnitPrice *float64 `json:"unit_price,omitempty"` - // Description of the unit type the item is sold as, ie: kg, hour. - UnitOfMeasure *string `json:"unit_of_measure,omitempty"` - // Amounts are including tax - TaxInclusive *bool `json:"tax_inclusive,omitempty"` - TaxRate *LinkedTaxRateInput `json:"tax_rate,omitempty"` -} - -func (o *SalesDetailsInput) GetUnitPrice() *float64 { - if o == nil { - return nil - } - return o.UnitPrice -} - -func (o *SalesDetailsInput) GetUnitOfMeasure() *string { - if o == nil { - return nil - } - return o.UnitOfMeasure -} - -func (o *SalesDetailsInput) GetTaxInclusive() *bool { - if o == nil { - return nil - } - return o.TaxInclusive -} - -func (o *SalesDetailsInput) GetTaxRate() *LinkedTaxRateInput { - if o == nil { - return nil - } - return o.TaxRate -} - -type PurchaseDetailsInput struct { - UnitPrice *float64 `json:"unit_price,omitempty"` - // Description of the unit type the item is sold as, ie: kg, hour. - UnitOfMeasure *string `json:"unit_of_measure,omitempty"` - // Amounts are including tax - TaxInclusive *bool `json:"tax_inclusive,omitempty"` - TaxRate *LinkedTaxRateInput `json:"tax_rate,omitempty"` -} - -func (o *PurchaseDetailsInput) GetUnitPrice() *float64 { - if o == nil { - return nil - } - return o.UnitPrice -} - -func (o *PurchaseDetailsInput) GetUnitOfMeasure() *string { - if o == nil { - return nil - } - return o.UnitOfMeasure -} - -func (o *PurchaseDetailsInput) GetTaxInclusive() *bool { - if o == nil { - return nil - } - return o.TaxInclusive -} - -func (o *PurchaseDetailsInput) GetTaxRate() *LinkedTaxRateInput { - if o == nil { - return nil - } - return o.TaxRate -} - -type InvoiceItemInput struct { - // Item name - Name *string `json:"name,omitempty"` - // A short description of the item - Description *string `json:"description,omitempty"` - // User defined item code - Code *string `json:"code,omitempty"` - // Item will be available on sales transactions - Sold *bool `json:"sold,omitempty"` - // Item is available for purchase transactions - Purchased *bool `json:"purchased,omitempty"` - // Item is inventoried - Tracked *bool `json:"tracked,omitempty"` - // If true, transactions for this item are taxable - Taxable *bool `json:"taxable,omitempty"` - // The date of opening balance if inventory item is tracked - YYYY-MM-DD. - InventoryDate *types.Date `json:"inventory_date,omitempty"` - // Item type - Type *InvoiceItemType `json:"type,omitempty"` - SalesDetails *SalesDetailsInput `json:"sales_details,omitempty"` - PurchaseDetails *PurchaseDetailsInput `json:"purchase_details,omitempty"` - Quantity *float64 `json:"quantity,omitempty"` - UnitPrice *float64 `json:"unit_price,omitempty"` - AssetAccount *LinkedLedgerAccountInput `json:"asset_account,omitempty"` - IncomeAccount *LinkedLedgerAccountInput `json:"income_account,omitempty"` - ExpenseAccount *LinkedLedgerAccountInput `json:"expense_account,omitempty"` - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - TrackingCategory *DeprecatedLinkedTrackingCategory `json:"tracking_category,omitempty"` - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - Active *bool `json:"active,omitempty"` - // The ID of the department - DepartmentID *string `json:"department_id,omitempty"` - // The ID of the location - LocationID *string `json:"location_id,omitempty"` - // The ID of the subsidiary - SubsidiaryID *string `json:"subsidiary_id,omitempty"` - // The ID of the tax schedule - TaxScheduleID *string `json:"tax_schedule_id,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (i InvoiceItemInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *InvoiceItemInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *InvoiceItemInput) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *InvoiceItemInput) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *InvoiceItemInput) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *InvoiceItemInput) GetSold() *bool { - if o == nil { - return nil - } - return o.Sold -} - -func (o *InvoiceItemInput) GetPurchased() *bool { - if o == nil { - return nil - } - return o.Purchased -} - -func (o *InvoiceItemInput) GetTracked() *bool { - if o == nil { - return nil - } - return o.Tracked -} - -func (o *InvoiceItemInput) GetTaxable() *bool { - if o == nil { - return nil - } - return o.Taxable -} - -func (o *InvoiceItemInput) GetInventoryDate() *types.Date { - if o == nil { - return nil - } - return o.InventoryDate -} - -func (o *InvoiceItemInput) GetType() *InvoiceItemType { - if o == nil { - return nil - } - return o.Type -} - -func (o *InvoiceItemInput) GetSalesDetails() *SalesDetailsInput { - if o == nil { - return nil - } - return o.SalesDetails -} - -func (o *InvoiceItemInput) GetPurchaseDetails() *PurchaseDetailsInput { - if o == nil { - return nil - } - return o.PurchaseDetails -} - -func (o *InvoiceItemInput) GetQuantity() *float64 { - if o == nil { - return nil - } - return o.Quantity -} - -func (o *InvoiceItemInput) GetUnitPrice() *float64 { - if o == nil { - return nil - } - return o.UnitPrice -} - -func (o *InvoiceItemInput) GetAssetAccount() *LinkedLedgerAccountInput { - if o == nil { - return nil - } - return o.AssetAccount -} - -func (o *InvoiceItemInput) GetIncomeAccount() *LinkedLedgerAccountInput { - if o == nil { - return nil - } - return o.IncomeAccount -} - -func (o *InvoiceItemInput) GetExpenseAccount() *LinkedLedgerAccountInput { - if o == nil { - return nil - } - return o.ExpenseAccount -} - -func (o *InvoiceItemInput) GetTrackingCategory() *DeprecatedLinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategory -} - -func (o *InvoiceItemInput) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *InvoiceItemInput) GetActive() *bool { - if o == nil { - return nil - } - return o.Active -} - -func (o *InvoiceItemInput) GetDepartmentID() *string { - if o == nil { - return nil - } - return o.DepartmentID -} - -func (o *InvoiceItemInput) GetLocationID() *string { - if o == nil { - return nil - } - return o.LocationID -} - -func (o *InvoiceItemInput) GetSubsidiaryID() *string { - if o == nil { - return nil - } - return o.SubsidiaryID -} - -func (o *InvoiceItemInput) GetTaxScheduleID() *string { - if o == nil { - return nil - } - return o.TaxScheduleID -} - -func (o *InvoiceItemInput) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *InvoiceItemInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/invoiceitemfilter.go b/tests/mockserver/internal/sdk/models/components/invoiceitemfilter.go deleted file mode 100644 index 9ef3a33a..00000000 --- a/tests/mockserver/internal/sdk/models/components/invoiceitemfilter.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// InvoiceItemFilterInvoiceItemType - The type of invoice item, indicating whether it is an inventory item, a service, or another type. -type InvoiceItemFilterInvoiceItemType string - -const ( - InvoiceItemFilterInvoiceItemTypeInventory InvoiceItemFilterInvoiceItemType = "inventory" - InvoiceItemFilterInvoiceItemTypeService InvoiceItemFilterInvoiceItemType = "service" - InvoiceItemFilterInvoiceItemTypeOther InvoiceItemFilterInvoiceItemType = "other" -) - -func (e InvoiceItemFilterInvoiceItemType) ToPointer() *InvoiceItemFilterInvoiceItemType { - return &e -} -func (e *InvoiceItemFilterInvoiceItemType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "inventory": - fallthrough - case "service": - fallthrough - case "other": - *e = InvoiceItemFilterInvoiceItemType(v) - return nil - default: - return fmt.Errorf("invalid value for InvoiceItemFilterInvoiceItemType: %v", v) - } -} - -type InvoiceItemFilter struct { - // The type of invoice item, indicating whether it is an inventory item, a service, or another type. - Type *InvoiceItemFilterInvoiceItemType `queryParam:"name=type"` -} - -func (o *InvoiceItemFilter) GetType() *InvoiceItemFilterInvoiceItemType { - if o == nil { - return nil - } - return o.Type -} diff --git a/tests/mockserver/internal/sdk/models/components/invoiceitemsfilter.go b/tests/mockserver/internal/sdk/models/components/invoiceitemsfilter.go deleted file mode 100644 index 2c17d24b..00000000 --- a/tests/mockserver/internal/sdk/models/components/invoiceitemsfilter.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// InvoiceItemsFilterInvoiceItemType - The type of invoice item, indicating whether it is an inventory item, a service, or another type. -type InvoiceItemsFilterInvoiceItemType string - -const ( - InvoiceItemsFilterInvoiceItemTypeInventory InvoiceItemsFilterInvoiceItemType = "inventory" - InvoiceItemsFilterInvoiceItemTypeService InvoiceItemsFilterInvoiceItemType = "service" - InvoiceItemsFilterInvoiceItemTypeOther InvoiceItemsFilterInvoiceItemType = "other" -) - -func (e InvoiceItemsFilterInvoiceItemType) ToPointer() *InvoiceItemsFilterInvoiceItemType { - return &e -} -func (e *InvoiceItemsFilterInvoiceItemType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "inventory": - fallthrough - case "service": - fallthrough - case "other": - *e = InvoiceItemsFilterInvoiceItemType(v) - return nil - default: - return fmt.Errorf("invalid value for InvoiceItemsFilterInvoiceItemType: %v", v) - } -} - -type InvoiceItemsFilter struct { - // Name of Invoice Items to search for - Name *string `queryParam:"name=name"` - // The type of invoice item, indicating whether it is an inventory item, a service, or another type. - Type *InvoiceItemsFilterInvoiceItemType `queryParam:"name=type"` -} - -func (o *InvoiceItemsFilter) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *InvoiceItemsFilter) GetType() *InvoiceItemsFilterInvoiceItemType { - if o == nil { - return nil - } - return o.Type -} diff --git a/tests/mockserver/internal/sdk/models/components/invoiceitemssort.go b/tests/mockserver/internal/sdk/models/components/invoiceitemssort.go deleted file mode 100644 index e915ac5d..00000000 --- a/tests/mockserver/internal/sdk/models/components/invoiceitemssort.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// InvoiceItemsSortBy - The field on which to sort the Invoice Items -type InvoiceItemsSortBy string - -const ( - InvoiceItemsSortByCreatedAt InvoiceItemsSortBy = "created_at" - InvoiceItemsSortByUpdatedAt InvoiceItemsSortBy = "updated_at" -) - -func (e InvoiceItemsSortBy) ToPointer() *InvoiceItemsSortBy { - return &e -} -func (e *InvoiceItemsSortBy) 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 = InvoiceItemsSortBy(v) - return nil - default: - return fmt.Errorf("invalid value for InvoiceItemsSortBy: %v", v) - } -} - -type InvoiceItemsSort struct { - // The field on which to sort the Invoice Items - By *InvoiceItemsSortBy `queryParam:"name=by"` - // The direction in which to sort the results - Direction *SortDirection `default:"asc" queryParam:"name=direction"` -} - -func (i InvoiceItemsSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *InvoiceItemsSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *InvoiceItemsSort) GetBy() *InvoiceItemsSortBy { - if o == nil { - return nil - } - return o.By -} - -func (o *InvoiceItemsSort) GetDirection() *SortDirection { - if o == nil { - return nil - } - return o.Direction -} diff --git a/tests/mockserver/internal/sdk/models/components/invoicelineitem.go b/tests/mockserver/internal/sdk/models/components/invoicelineitem.go deleted file mode 100644 index 67d0a1d4..00000000 --- a/tests/mockserver/internal/sdk/models/components/invoicelineitem.go +++ /dev/null @@ -1,468 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// InvoiceLineItemType - Item type -type InvoiceLineItemType string - -const ( - InvoiceLineItemTypeSalesItem InvoiceLineItemType = "sales_item" - InvoiceLineItemTypeDiscount InvoiceLineItemType = "discount" - InvoiceLineItemTypeInfo InvoiceLineItemType = "info" - InvoiceLineItemTypeSubTotal InvoiceLineItemType = "sub_total" - InvoiceLineItemTypeService InvoiceLineItemType = "service" - InvoiceLineItemTypeOther InvoiceLineItemType = "other" -) - -func (e InvoiceLineItemType) ToPointer() *InvoiceLineItemType { - return &e -} -func (e *InvoiceLineItemType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "sales_item": - fallthrough - case "discount": - fallthrough - case "info": - fallthrough - case "sub_total": - fallthrough - case "service": - fallthrough - case "other": - *e = InvoiceLineItemType(v) - return nil - default: - return fmt.Errorf("invalid value for InvoiceLineItemType: %v", v) - } -} - -type InvoiceLineItem struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // Row ID - RowID *string `json:"row_id,omitempty"` - // User defined item code - Code *string `json:"code,omitempty"` - // Line number of the resource - LineNumber *int64 `json:"line_number,omitempty"` - // User defined description - Description *string `json:"description,omitempty"` - // Item type - Type *InvoiceLineItemType `json:"type,omitempty"` - // Tax amount - TaxAmount *float64 `json:"tax_amount,omitempty"` - // Total amount of the line item - TotalAmount *float64 `json:"total_amount,omitempty"` - Quantity *float64 `json:"quantity,omitempty"` - UnitPrice *float64 `json:"unit_price,omitempty"` - // Description of the unit type the item is sold as, ie: kg, hour. - UnitOfMeasure *string `json:"unit_of_measure,omitempty"` - // Discount percentage applied to the line item when supported downstream. - DiscountPercentage *float64 `json:"discount_percentage,omitempty"` - // Discount amount applied to the line item when supported downstream. - DiscountAmount *float64 `json:"discount_amount,omitempty"` - // The ID of the location - LocationID *string `json:"location_id,omitempty"` - // The ID of the department - DepartmentID *string `json:"department_id,omitempty"` - Item *LinkedInvoiceItem `json:"item,omitempty"` - TaxRate *LinkedTaxRate `json:"tax_rate,omitempty"` - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - LedgerAccount *LinkedLedgerAccount `json:"ledger_account,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,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"` -} - -func (i InvoiceLineItem) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *InvoiceLineItem) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *InvoiceLineItem) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *InvoiceLineItem) GetRowID() *string { - if o == nil { - return nil - } - return o.RowID -} - -func (o *InvoiceLineItem) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *InvoiceLineItem) GetLineNumber() *int64 { - if o == nil { - return nil - } - return o.LineNumber -} - -func (o *InvoiceLineItem) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *InvoiceLineItem) GetType() *InvoiceLineItemType { - if o == nil { - return nil - } - return o.Type -} - -func (o *InvoiceLineItem) GetTaxAmount() *float64 { - if o == nil { - return nil - } - return o.TaxAmount -} - -func (o *InvoiceLineItem) GetTotalAmount() *float64 { - if o == nil { - return nil - } - return o.TotalAmount -} - -func (o *InvoiceLineItem) GetQuantity() *float64 { - if o == nil { - return nil - } - return o.Quantity -} - -func (o *InvoiceLineItem) GetUnitPrice() *float64 { - if o == nil { - return nil - } - return o.UnitPrice -} - -func (o *InvoiceLineItem) GetUnitOfMeasure() *string { - if o == nil { - return nil - } - return o.UnitOfMeasure -} - -func (o *InvoiceLineItem) GetDiscountPercentage() *float64 { - if o == nil { - return nil - } - return o.DiscountPercentage -} - -func (o *InvoiceLineItem) GetDiscountAmount() *float64 { - if o == nil { - return nil - } - return o.DiscountAmount -} - -func (o *InvoiceLineItem) GetLocationID() *string { - if o == nil { - return nil - } - return o.LocationID -} - -func (o *InvoiceLineItem) GetDepartmentID() *string { - if o == nil { - return nil - } - return o.DepartmentID -} - -func (o *InvoiceLineItem) GetItem() *LinkedInvoiceItem { - if o == nil { - return nil - } - return o.Item -} - -func (o *InvoiceLineItem) GetTaxRate() *LinkedTaxRate { - if o == nil { - return nil - } - return o.TaxRate -} - -func (o *InvoiceLineItem) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *InvoiceLineItem) GetLedgerAccount() *LinkedLedgerAccount { - if o == nil { - return nil - } - return o.LedgerAccount -} - -func (o *InvoiceLineItem) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *InvoiceLineItem) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *InvoiceLineItem) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *InvoiceLineItem) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *InvoiceLineItem) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *InvoiceLineItem) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -type InvoiceLineItemInput struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // Row ID - RowID *string `json:"row_id,omitempty"` - // User defined item code - Code *string `json:"code,omitempty"` - // Line number of the resource - LineNumber *int64 `json:"line_number,omitempty"` - // User defined description - Description *string `json:"description,omitempty"` - // Item type - Type *InvoiceLineItemType `json:"type,omitempty"` - // Tax amount - TaxAmount *float64 `json:"tax_amount,omitempty"` - // Total amount of the line item - TotalAmount *float64 `json:"total_amount,omitempty"` - Quantity *float64 `json:"quantity,omitempty"` - UnitPrice *float64 `json:"unit_price,omitempty"` - // Description of the unit type the item is sold as, ie: kg, hour. - UnitOfMeasure *string `json:"unit_of_measure,omitempty"` - // Discount percentage applied to the line item when supported downstream. - DiscountPercentage *float64 `json:"discount_percentage,omitempty"` - // Discount amount applied to the line item when supported downstream. - DiscountAmount *float64 `json:"discount_amount,omitempty"` - // The ID of the location - LocationID *string `json:"location_id,omitempty"` - // The ID of the department - DepartmentID *string `json:"department_id,omitempty"` - Item *LinkedInvoiceItem `json:"item,omitempty"` - TaxRate *LinkedTaxRateInput `json:"tax_rate,omitempty"` - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - LedgerAccount *LinkedLedgerAccountInput `json:"ledger_account,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` -} - -func (o *InvoiceLineItemInput) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *InvoiceLineItemInput) GetRowID() *string { - if o == nil { - return nil - } - return o.RowID -} - -func (o *InvoiceLineItemInput) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *InvoiceLineItemInput) GetLineNumber() *int64 { - if o == nil { - return nil - } - return o.LineNumber -} - -func (o *InvoiceLineItemInput) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *InvoiceLineItemInput) GetType() *InvoiceLineItemType { - if o == nil { - return nil - } - return o.Type -} - -func (o *InvoiceLineItemInput) GetTaxAmount() *float64 { - if o == nil { - return nil - } - return o.TaxAmount -} - -func (o *InvoiceLineItemInput) GetTotalAmount() *float64 { - if o == nil { - return nil - } - return o.TotalAmount -} - -func (o *InvoiceLineItemInput) GetQuantity() *float64 { - if o == nil { - return nil - } - return o.Quantity -} - -func (o *InvoiceLineItemInput) GetUnitPrice() *float64 { - if o == nil { - return nil - } - return o.UnitPrice -} - -func (o *InvoiceLineItemInput) GetUnitOfMeasure() *string { - if o == nil { - return nil - } - return o.UnitOfMeasure -} - -func (o *InvoiceLineItemInput) GetDiscountPercentage() *float64 { - if o == nil { - return nil - } - return o.DiscountPercentage -} - -func (o *InvoiceLineItemInput) GetDiscountAmount() *float64 { - if o == nil { - return nil - } - return o.DiscountAmount -} - -func (o *InvoiceLineItemInput) GetLocationID() *string { - if o == nil { - return nil - } - return o.LocationID -} - -func (o *InvoiceLineItemInput) GetDepartmentID() *string { - if o == nil { - return nil - } - return o.DepartmentID -} - -func (o *InvoiceLineItemInput) GetItem() *LinkedInvoiceItem { - if o == nil { - return nil - } - return o.Item -} - -func (o *InvoiceLineItemInput) GetTaxRate() *LinkedTaxRateInput { - if o == nil { - return nil - } - return o.TaxRate -} - -func (o *InvoiceLineItemInput) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *InvoiceLineItemInput) GetLedgerAccount() *LinkedLedgerAccountInput { - if o == nil { - return nil - } - return o.LedgerAccount -} - -func (o *InvoiceLineItemInput) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *InvoiceLineItemInput) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} diff --git a/tests/mockserver/internal/sdk/models/components/invoiceresponse.go b/tests/mockserver/internal/sdk/models/components/invoiceresponse.go deleted file mode 100644 index cff31419..00000000 --- a/tests/mockserver/internal/sdk/models/components/invoiceresponse.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type InvoiceResponse struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The third-party API ID of original entity - DownstreamID *string `json:"downstream_id,omitempty"` -} - -func (o *InvoiceResponse) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *InvoiceResponse) GetDownstreamID() *string { - if o == nil { - return nil - } - return o.DownstreamID -} diff --git a/tests/mockserver/internal/sdk/models/components/invoicesfilter.go b/tests/mockserver/internal/sdk/models/components/invoicesfilter.go deleted file mode 100644 index 7f2eb94b..00000000 --- a/tests/mockserver/internal/sdk/models/components/invoicesfilter.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type InvoicesFilter struct { - UpdatedSince *time.Time `queryParam:"name=updated_since"` - CreatedSince *time.Time `queryParam:"name=created_since"` - // Invoice number to search for - Number *string `queryParam:"name=number"` -} - -func (i InvoicesFilter) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *InvoicesFilter) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *InvoicesFilter) GetUpdatedSince() *time.Time { - if o == nil { - return nil - } - return o.UpdatedSince -} - -func (o *InvoicesFilter) GetCreatedSince() *time.Time { - if o == nil { - return nil - } - return o.CreatedSince -} - -func (o *InvoicesFilter) GetNumber() *string { - if o == nil { - return nil - } - return o.Number -} diff --git a/tests/mockserver/internal/sdk/models/components/invoicessort.go b/tests/mockserver/internal/sdk/models/components/invoicessort.go deleted file mode 100644 index 922a44b9..00000000 --- a/tests/mockserver/internal/sdk/models/components/invoicessort.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// InvoicesSortBy - The field on which to sort the Invoices -type InvoicesSortBy string - -const ( - InvoicesSortByCreatedAt InvoicesSortBy = "created_at" - InvoicesSortByUpdatedAt InvoicesSortBy = "updated_at" -) - -func (e InvoicesSortBy) ToPointer() *InvoicesSortBy { - return &e -} -func (e *InvoicesSortBy) 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 = InvoicesSortBy(v) - return nil - default: - return fmt.Errorf("invalid value for InvoicesSortBy: %v", v) - } -} - -type InvoicesSort struct { - // The field on which to sort the Invoices - By *InvoicesSortBy `queryParam:"name=by"` - // The direction in which to sort the results - Direction *SortDirection `default:"asc" queryParam:"name=direction"` -} - -func (i InvoicesSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *InvoicesSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *InvoicesSort) GetBy() *InvoicesSortBy { - if o == nil { - return nil - } - return o.By -} - -func (o *InvoicesSort) GetDirection() *SortDirection { - if o == nil { - return nil - } - return o.Direction -} diff --git a/tests/mockserver/internal/sdk/models/components/issuesfilter.go b/tests/mockserver/internal/sdk/models/components/issuesfilter.go deleted file mode 100644 index a34b1995..00000000 --- a/tests/mockserver/internal/sdk/models/components/issuesfilter.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type IssuesFilter struct { - // Filter by ticket status, can be `open`, `closed` or `all`. Will passthrough if none of the above match - Status []string `queryParam:"name=status"` - // Only return tickets since a specific date - Since *time.Time `queryParam:"name=since"` - // Only return tickets assigned to a specific user - AssigneeID *string `queryParam:"name=assignee_id"` -} - -func (i IssuesFilter) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *IssuesFilter) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *IssuesFilter) GetStatus() []string { - if o == nil { - return nil - } - return o.Status -} - -func (o *IssuesFilter) GetSince() *time.Time { - if o == nil { - return nil - } - return o.Since -} - -func (o *IssuesFilter) GetAssigneeID() *string { - if o == nil { - return nil - } - return o.AssigneeID -} diff --git a/tests/mockserver/internal/sdk/models/components/job.go b/tests/mockserver/internal/sdk/models/components/job.go deleted file mode 100644 index 865684ce..00000000 --- a/tests/mockserver/internal/sdk/models/components/job.go +++ /dev/null @@ -1,595 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/types" - "mockserver/internal/sdk/utils" - "time" -) - -// Visibility - The visibility of the job -type Visibility string - -const ( - VisibilityDraft Visibility = "draft" - VisibilityPublic Visibility = "public" - VisibilityInternal Visibility = "internal" -) - -func (e Visibility) ToPointer() *Visibility { - return &e -} -func (e *Visibility) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "draft": - fallthrough - case "public": - fallthrough - case "internal": - *e = Visibility(v) - return nil - default: - return fmt.Errorf("invalid value for Visibility: %v", v) - } -} - -type EmploymentTerms string - -const ( - EmploymentTermsFullTime EmploymentTerms = "full-time" - EmploymentTermsPartTime EmploymentTerms = "part-time" - EmploymentTermsInternship EmploymentTerms = "internship" - EmploymentTermsContractor EmploymentTerms = "contractor" - EmploymentTermsEmployee EmploymentTerms = "employee" - EmploymentTermsFreelance EmploymentTerms = "freelance" - EmploymentTermsTemp EmploymentTerms = "temp" - EmploymentTermsSeasonal EmploymentTerms = "seasonal" - EmploymentTermsVolunteer EmploymentTerms = "volunteer" - EmploymentTermsOther EmploymentTerms = "other" -) - -func (e EmploymentTerms) ToPointer() *EmploymentTerms { - return &e -} -func (e *EmploymentTerms) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "full-time": - fallthrough - case "part-time": - fallthrough - case "internship": - fallthrough - case "contractor": - fallthrough - case "employee": - fallthrough - case "freelance": - fallthrough - case "temp": - fallthrough - case "seasonal": - fallthrough - case "volunteer": - fallthrough - case "other": - *e = EmploymentTerms(v) - return nil - default: - return fmt.Errorf("invalid value for EmploymentTerms: %v", v) - } -} - -// Branch - Details of the branch for which the job is created. -type Branch struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // Name of the branch. - Name *string `json:"name,omitempty"` -} - -func (o *Branch) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Branch) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -type Block struct { - Title *string `json:"title,omitempty"` - Content *string `json:"content,omitempty"` -} - -func (o *Block) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *Block) GetContent() *string { - if o == nil { - return nil - } - return o.Content -} - -type Salary struct { - // Minimum salary payable for the job role. - Min *int64 `json:"min,omitempty"` - // Maximum salary payable for the job role. - Max *int64 `json:"max,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"` - Interval *string `json:"interval,omitempty"` -} - -func (o *Salary) GetMin() *int64 { - if o == nil { - return nil - } - return o.Min -} - -func (o *Salary) GetMax() *int64 { - if o == nil { - return nil - } - return o.Max -} - -func (o *Salary) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *Salary) GetInterval() *string { - if o == nil { - return nil - } - return o.Interval -} - -type JobType string - -const ( - JobTypeJobPortal JobType = "job_portal" - JobTypeJobDescription JobType = "job_description" -) - -func (e JobType) ToPointer() *JobType { - return &e -} -func (e *JobType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "job_portal": - fallthrough - case "job_description": - *e = JobType(v) - return nil - default: - return fmt.Errorf("invalid value for JobType: %v", v) - } -} - -type Link struct { - Type *JobType `json:"type,omitempty"` - URL *string `json:"url,omitempty"` -} - -func (o *Link) GetType() *JobType { - if o == nil { - return nil - } - return o.Type -} - -func (o *Link) GetURL() *string { - if o == nil { - return nil - } - return o.URL -} - -type Job struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - Slug *string `json:"slug,omitempty"` - // The job title of the person. - Title *string `json:"title,omitempty"` - // Sequence in relation to other jobs. - Sequence *int64 `json:"sequence,omitempty"` - // The visibility of the job - Visibility *Visibility `json:"visibility,omitempty"` - // The status of the job. - Status *JobStatus `json:"status,omitempty"` - // The code of the job. - Code *string `json:"code,omitempty"` - // language code according to ISO 639-1. For the United States - EN - Language *string `json:"language,omitempty"` - EmploymentTerms *EmploymentTerms `json:"employment_terms,omitempty"` - // Level of experience required for the job role. - Experience *string `json:"experience,omitempty"` - // Specifies the location for the job posting. - Location *string `json:"location,omitempty"` - // Specifies whether the posting is for a remote job. - Remote *bool `json:"remote,omitempty"` - // A job's Requisition ID (Req ID) allows your organization to identify and track a job based on alphanumeric naming conventions unique to your company's internal processes. - RequisitionID *string `json:"requisition_id,omitempty"` - Department *Department `json:"department,omitempty"` - // Details of the branch for which the job is created. - Branch *Branch `json:"branch,omitempty"` - // The recruiter is generally someone who is tasked to help the hiring manager find and screen qualified applicant - Recruiters []string `json:"recruiters,omitempty"` - HiringManagers []string `json:"hiring_managers,omitempty"` - Followers []string `json:"followers,omitempty"` - // A description of the object. - Description *string `json:"description,omitempty"` - // The job description in HTML format - DescriptionHTML *string `json:"description_html,omitempty"` - Blocks []Block `json:"blocks,omitempty"` - Closing *string `json:"closing,omitempty"` - // The closing section of the job description in HTML format - ClosingHTML *string `json:"closing_html,omitempty"` - ClosingDate *types.Date `json:"closing_date,omitempty"` - Salary *Salary `json:"salary,omitempty"` - // URL of the job description - // - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - URL *string `json:"url,omitempty"` - // URL of the job portal - // - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - JobPortalURL *string `json:"job_portal_url,omitempty"` - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - RecordURL *string `json:"record_url,omitempty"` - Links []Link `json:"links,omitempty"` - Confidential *bool `json:"confidential,omitempty"` - // Specifies whether an employee of the organization can apply for the job. - AvailableToEmployees *bool `json:"available_to_employees,omitempty"` - Tags []string `json:"tags,omitempty"` - Addresses []Address `json:"addresses,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // Flag to indicate if the object is deleted. - Deleted *bool `json:"deleted,omitempty"` - OwnerID *string `json:"owner_id,omitempty"` - PublishedAt *time.Time `json:"published_at,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` -} - -func (j Job) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(j, "", false) -} - -func (j *Job) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &j, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Job) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Job) GetSlug() *string { - if o == nil { - return nil - } - return o.Slug -} - -func (o *Job) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *Job) GetSequence() *int64 { - if o == nil { - return nil - } - return o.Sequence -} - -func (o *Job) GetVisibility() *Visibility { - if o == nil { - return nil - } - return o.Visibility -} - -func (o *Job) GetStatus() *JobStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *Job) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *Job) GetLanguage() *string { - if o == nil { - return nil - } - return o.Language -} - -func (o *Job) GetEmploymentTerms() *EmploymentTerms { - if o == nil { - return nil - } - return o.EmploymentTerms -} - -func (o *Job) GetExperience() *string { - if o == nil { - return nil - } - return o.Experience -} - -func (o *Job) GetLocation() *string { - if o == nil { - return nil - } - return o.Location -} - -func (o *Job) GetRemote() *bool { - if o == nil { - return nil - } - return o.Remote -} - -func (o *Job) GetRequisitionID() *string { - if o == nil { - return nil - } - return o.RequisitionID -} - -func (o *Job) GetDepartment() *Department { - if o == nil { - return nil - } - return o.Department -} - -func (o *Job) GetBranch() *Branch { - if o == nil { - return nil - } - return o.Branch -} - -func (o *Job) GetRecruiters() []string { - if o == nil { - return nil - } - return o.Recruiters -} - -func (o *Job) GetHiringManagers() []string { - if o == nil { - return nil - } - return o.HiringManagers -} - -func (o *Job) GetFollowers() []string { - if o == nil { - return nil - } - return o.Followers -} - -func (o *Job) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *Job) GetDescriptionHTML() *string { - if o == nil { - return nil - } - return o.DescriptionHTML -} - -func (o *Job) GetBlocks() []Block { - if o == nil { - return nil - } - return o.Blocks -} - -func (o *Job) GetClosing() *string { - if o == nil { - return nil - } - return o.Closing -} - -func (o *Job) GetClosingHTML() *string { - if o == nil { - return nil - } - return o.ClosingHTML -} - -func (o *Job) GetClosingDate() *types.Date { - if o == nil { - return nil - } - return o.ClosingDate -} - -func (o *Job) GetSalary() *Salary { - if o == nil { - return nil - } - return o.Salary -} - -func (o *Job) GetURL() *string { - if o == nil { - return nil - } - return o.URL -} - -func (o *Job) GetJobPortalURL() *string { - if o == nil { - return nil - } - return o.JobPortalURL -} - -func (o *Job) GetRecordURL() *string { - if o == nil { - return nil - } - return o.RecordURL -} - -func (o *Job) GetLinks() []Link { - if o == nil { - return nil - } - return o.Links -} - -func (o *Job) GetConfidential() *bool { - if o == nil { - return nil - } - return o.Confidential -} - -func (o *Job) GetAvailableToEmployees() *bool { - if o == nil { - return nil - } - return o.AvailableToEmployees -} - -func (o *Job) GetTags() []string { - if o == nil { - return nil - } - return o.Tags -} - -func (o *Job) GetAddresses() []Address { - if o == nil { - return nil - } - return o.Addresses -} - -func (o *Job) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *Job) GetDeleted() *bool { - if o == nil { - return nil - } - return o.Deleted -} - -func (o *Job) GetOwnerID() *string { - if o == nil { - return nil - } - return o.OwnerID -} - -func (o *Job) GetPublishedAt() *time.Time { - if o == nil { - return nil - } - return o.PublishedAt -} - -func (o *Job) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Job) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *Job) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *Job) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Job) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} diff --git a/tests/mockserver/internal/sdk/models/components/jobstatus.go b/tests/mockserver/internal/sdk/models/components/jobstatus.go deleted file mode 100644 index c3dab651..00000000 --- a/tests/mockserver/internal/sdk/models/components/jobstatus.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// JobStatus - The status of the job. -type JobStatus string - -const ( - JobStatusDraft JobStatus = "draft" - JobStatusInternal JobStatus = "internal" - JobStatusPublished JobStatus = "published" - JobStatusCompleted JobStatus = "completed" - JobStatusOnHold JobStatus = "on-hold" - JobStatusPrivate JobStatus = "private" -) - -func (e JobStatus) ToPointer() *JobStatus { - return &e -} -func (e *JobStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "draft": - fallthrough - case "internal": - fallthrough - case "published": - fallthrough - case "completed": - fallthrough - case "on-hold": - fallthrough - case "private": - *e = JobStatus(v) - return nil - default: - return fmt.Errorf("invalid value for JobStatus: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/journalentriesfilter.go b/tests/mockserver/internal/sdk/models/components/journalentriesfilter.go deleted file mode 100644 index af9bd16b..00000000 --- a/tests/mockserver/internal/sdk/models/components/journalentriesfilter.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type JournalEntriesFilter struct { - UpdatedSince *time.Time `queryParam:"name=updated_since"` -} - -func (j JournalEntriesFilter) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(j, "", false) -} - -func (j *JournalEntriesFilter) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &j, "", false, false); err != nil { - return err - } - return nil -} - -func (o *JournalEntriesFilter) GetUpdatedSince() *time.Time { - if o == nil { - return nil - } - return o.UpdatedSince -} diff --git a/tests/mockserver/internal/sdk/models/components/journalentriessort.go b/tests/mockserver/internal/sdk/models/components/journalentriessort.go deleted file mode 100644 index d0a460b1..00000000 --- a/tests/mockserver/internal/sdk/models/components/journalentriessort.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// JournalEntriesSortBy - The field on which to sort the Journal Entries. -type JournalEntriesSortBy string - -const ( - JournalEntriesSortByCreatedAt JournalEntriesSortBy = "created_at" - JournalEntriesSortByUpdatedAt JournalEntriesSortBy = "updated_at" -) - -func (e JournalEntriesSortBy) ToPointer() *JournalEntriesSortBy { - return &e -} -func (e *JournalEntriesSortBy) 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 = JournalEntriesSortBy(v) - return nil - default: - return fmt.Errorf("invalid value for JournalEntriesSortBy: %v", v) - } -} - -type JournalEntriesSort struct { - // The field on which to sort the Journal Entries. - By *JournalEntriesSortBy `queryParam:"name=by"` - // The direction in which to sort the results - Direction *SortDirection `default:"asc" queryParam:"name=direction"` -} - -func (j JournalEntriesSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(j, "", false) -} - -func (j *JournalEntriesSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &j, "", false, false); err != nil { - return err - } - return nil -} - -func (o *JournalEntriesSort) GetBy() *JournalEntriesSortBy { - if o == nil { - return nil - } - return o.By -} - -func (o *JournalEntriesSort) GetDirection() *SortDirection { - if o == nil { - return nil - } - return o.Direction -} diff --git a/tests/mockserver/internal/sdk/models/components/journalentry.go b/tests/mockserver/internal/sdk/models/components/journalentry.go deleted file mode 100644 index b7a05d93..00000000 --- a/tests/mockserver/internal/sdk/models/components/journalentry.go +++ /dev/null @@ -1,441 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// JournalEntryStatus - Journal entry status -type JournalEntryStatus string - -const ( - JournalEntryStatusDraft JournalEntryStatus = "draft" - JournalEntryStatusPendingApproval JournalEntryStatus = "pending_approval" - JournalEntryStatusApproved JournalEntryStatus = "approved" - JournalEntryStatusPosted JournalEntryStatus = "posted" - JournalEntryStatusVoided JournalEntryStatus = "voided" - JournalEntryStatusRejected JournalEntryStatus = "rejected" - JournalEntryStatusDeleted JournalEntryStatus = "deleted" - JournalEntryStatusOther JournalEntryStatus = "other" -) - -func (e JournalEntryStatus) ToPointer() *JournalEntryStatus { - return &e -} -func (e *JournalEntryStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "draft": - fallthrough - case "pending_approval": - fallthrough - case "approved": - fallthrough - case "posted": - fallthrough - case "voided": - fallthrough - case "rejected": - fallthrough - case "deleted": - fallthrough - case "other": - *e = JournalEntryStatus(v) - return nil - default: - return fmt.Errorf("invalid value for JournalEntryStatus: %v", v) - } -} - -type JournalEntry struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // Journal entry title - Title *string `json:"title,omitempty"` - // Currency Exchange Rate at the time entity was recorded/generated. - CurrencyRate *float64 `json:"currency_rate,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 company or subsidiary id the transaction belongs to - CompanyID *string `json:"company_id,omitempty"` - // Requires a minimum of 2 line items that sum to 0 - LineItems []JournalEntryLineItem `json:"line_items,omitempty"` - // Journal entry status - Status *JournalEntryStatus `json:"status,omitempty"` - // Reference for the journal entry. - Memo *string `json:"memo,omitempty"` - // This is the date on which the journal entry was added. This can be different from the creation date and can also be backdated. - PostedAt *time.Time `json:"posted_at,omitempty"` - // Journal symbol of the entry. For example IND for indirect costs - JournalSymbol *string `json:"journal_symbol,omitempty"` - // The specific category of tax associated with a transaction like sales or purchase - TaxType *string `json:"tax_type,omitempty"` - // Applicable tax id/code override if tax is not supplied on a line item basis. - TaxCode *string `json:"tax_code,omitempty"` - // Journal entry number. - Number *string `json:"number,omitempty"` - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - // Accounting period - AccountingPeriod *string `json:"accounting_period,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (j JournalEntry) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(j, "", false) -} - -func (j *JournalEntry) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &j, "", false, false); err != nil { - return err - } - return nil -} - -func (o *JournalEntry) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *JournalEntry) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *JournalEntry) GetCurrencyRate() *float64 { - if o == nil { - return nil - } - return o.CurrencyRate -} - -func (o *JournalEntry) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *JournalEntry) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *JournalEntry) GetLineItems() []JournalEntryLineItem { - if o == nil { - return nil - } - return o.LineItems -} - -func (o *JournalEntry) GetStatus() *JournalEntryStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *JournalEntry) GetMemo() *string { - if o == nil { - return nil - } - return o.Memo -} - -func (o *JournalEntry) GetPostedAt() *time.Time { - if o == nil { - return nil - } - return o.PostedAt -} - -func (o *JournalEntry) GetJournalSymbol() *string { - if o == nil { - return nil - } - return o.JournalSymbol -} - -func (o *JournalEntry) GetTaxType() *string { - if o == nil { - return nil - } - return o.TaxType -} - -func (o *JournalEntry) GetTaxCode() *string { - if o == nil { - return nil - } - return o.TaxCode -} - -func (o *JournalEntry) GetNumber() *string { - if o == nil { - return nil - } - return o.Number -} - -func (o *JournalEntry) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *JournalEntry) GetAccountingPeriod() *string { - if o == nil { - return nil - } - return o.AccountingPeriod -} - -func (o *JournalEntry) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *JournalEntry) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *JournalEntry) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *JournalEntry) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *JournalEntry) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *JournalEntry) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *JournalEntry) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *JournalEntry) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type JournalEntryInput struct { - // Journal entry title - Title *string `json:"title,omitempty"` - // Currency Exchange Rate at the time entity was recorded/generated. - CurrencyRate *float64 `json:"currency_rate,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 company or subsidiary id the transaction belongs to - CompanyID *string `json:"company_id,omitempty"` - // Requires a minimum of 2 line items that sum to 0 - LineItems []JournalEntryLineItemInput `json:"line_items,omitempty"` - // Journal entry status - Status *JournalEntryStatus `json:"status,omitempty"` - // Reference for the journal entry. - Memo *string `json:"memo,omitempty"` - // This is the date on which the journal entry was added. This can be different from the creation date and can also be backdated. - PostedAt *time.Time `json:"posted_at,omitempty"` - // Journal symbol of the entry. For example IND for indirect costs - JournalSymbol *string `json:"journal_symbol,omitempty"` - // The specific category of tax associated with a transaction like sales or purchase - TaxType *string `json:"tax_type,omitempty"` - // Applicable tax id/code override if tax is not supplied on a line item basis. - TaxCode *string `json:"tax_code,omitempty"` - // Journal entry number. - Number *string `json:"number,omitempty"` - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - // Accounting period - AccountingPeriod *string `json:"accounting_period,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (j JournalEntryInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(j, "", false) -} - -func (j *JournalEntryInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &j, "", false, false); err != nil { - return err - } - return nil -} - -func (o *JournalEntryInput) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *JournalEntryInput) GetCurrencyRate() *float64 { - if o == nil { - return nil - } - return o.CurrencyRate -} - -func (o *JournalEntryInput) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *JournalEntryInput) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *JournalEntryInput) GetLineItems() []JournalEntryLineItemInput { - if o == nil { - return nil - } - return o.LineItems -} - -func (o *JournalEntryInput) GetStatus() *JournalEntryStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *JournalEntryInput) GetMemo() *string { - if o == nil { - return nil - } - return o.Memo -} - -func (o *JournalEntryInput) GetPostedAt() *time.Time { - if o == nil { - return nil - } - return o.PostedAt -} - -func (o *JournalEntryInput) GetJournalSymbol() *string { - if o == nil { - return nil - } - return o.JournalSymbol -} - -func (o *JournalEntryInput) GetTaxType() *string { - if o == nil { - return nil - } - return o.TaxType -} - -func (o *JournalEntryInput) GetTaxCode() *string { - if o == nil { - return nil - } - return o.TaxCode -} - -func (o *JournalEntryInput) GetNumber() *string { - if o == nil { - return nil - } - return o.Number -} - -func (o *JournalEntryInput) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *JournalEntryInput) GetAccountingPeriod() *string { - if o == nil { - return nil - } - return o.AccountingPeriod -} - -func (o *JournalEntryInput) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *JournalEntryInput) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *JournalEntryInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/journalentrylineitem.go b/tests/mockserver/internal/sdk/models/components/journalentrylineitem.go deleted file mode 100644 index 444238c2..00000000 --- a/tests/mockserver/internal/sdk/models/components/journalentrylineitem.go +++ /dev/null @@ -1,298 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// JournalEntryLineItemType - Debit entries are considered positive, and credit entries are considered negative. -type JournalEntryLineItemType string - -const ( - JournalEntryLineItemTypeDebit JournalEntryLineItemType = "debit" - JournalEntryLineItemTypeCredit JournalEntryLineItemType = "credit" -) - -func (e JournalEntryLineItemType) ToPointer() *JournalEntryLineItemType { - return &e -} -func (e *JournalEntryLineItemType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "debit": - fallthrough - case "credit": - *e = JournalEntryLineItemType(v) - return nil - default: - return fmt.Errorf("invalid value for JournalEntryLineItemType: %v", v) - } -} - -type JournalEntryLineItem struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // User defined description - Description *string `json:"description,omitempty"` - // Tax amount - TaxAmount *float64 `json:"tax_amount,omitempty"` - // Sub-total amount, normally before tax. - SubTotal *float64 `json:"sub_total,omitempty"` - // Debit entries are considered positive, and credit entries are considered negative. - TotalAmount *float64 `json:"total_amount,omitempty"` - // Debit entries are considered positive, and credit entries are considered negative. - Type JournalEntryLineItemType `json:"type"` - TaxRate *LinkedTaxRate `json:"tax_rate,omitempty"` - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - TrackingCategory *DeprecatedLinkedTrackingCategory `json:"tracking_category,omitempty"` - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - LedgerAccount *LinkedLedgerAccount `json:"ledger_account"` - // The customer this entity is linked to. - Customer *LinkedCustomer `json:"customer,omitempty"` - // The supplier this entity is linked to. - Supplier *LinkedSupplier `json:"supplier,omitempty"` - // The ID of the department - DepartmentID *string `json:"department_id,omitempty"` - // The ID of the location - LocationID *string `json:"location_id,omitempty"` - // Line number of the resource - LineNumber *int64 `json:"line_number,omitempty"` -} - -func (o *JournalEntryLineItem) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *JournalEntryLineItem) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *JournalEntryLineItem) GetTaxAmount() *float64 { - if o == nil { - return nil - } - return o.TaxAmount -} - -func (o *JournalEntryLineItem) GetSubTotal() *float64 { - if o == nil { - return nil - } - return o.SubTotal -} - -func (o *JournalEntryLineItem) GetTotalAmount() *float64 { - if o == nil { - return nil - } - return o.TotalAmount -} - -func (o *JournalEntryLineItem) GetType() JournalEntryLineItemType { - if o == nil { - return JournalEntryLineItemType("") - } - return o.Type -} - -func (o *JournalEntryLineItem) GetTaxRate() *LinkedTaxRate { - if o == nil { - return nil - } - return o.TaxRate -} - -func (o *JournalEntryLineItem) GetTrackingCategory() *DeprecatedLinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategory -} - -func (o *JournalEntryLineItem) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *JournalEntryLineItem) GetLedgerAccount() *LinkedLedgerAccount { - if o == nil { - return nil - } - return o.LedgerAccount -} - -func (o *JournalEntryLineItem) GetCustomer() *LinkedCustomer { - if o == nil { - return nil - } - return o.Customer -} - -func (o *JournalEntryLineItem) GetSupplier() *LinkedSupplier { - if o == nil { - return nil - } - return o.Supplier -} - -func (o *JournalEntryLineItem) GetDepartmentID() *string { - if o == nil { - return nil - } - return o.DepartmentID -} - -func (o *JournalEntryLineItem) GetLocationID() *string { - if o == nil { - return nil - } - return o.LocationID -} - -func (o *JournalEntryLineItem) GetLineNumber() *int64 { - if o == nil { - return nil - } - return o.LineNumber -} - -type JournalEntryLineItemInput struct { - // User defined description - Description *string `json:"description,omitempty"` - // Tax amount - TaxAmount *float64 `json:"tax_amount,omitempty"` - // Sub-total amount, normally before tax. - SubTotal *float64 `json:"sub_total,omitempty"` - // Debit entries are considered positive, and credit entries are considered negative. - TotalAmount *float64 `json:"total_amount,omitempty"` - // Debit entries are considered positive, and credit entries are considered negative. - Type JournalEntryLineItemType `json:"type"` - TaxRate *LinkedTaxRateInput `json:"tax_rate,omitempty"` - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - TrackingCategory *DeprecatedLinkedTrackingCategory `json:"tracking_category,omitempty"` - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - LedgerAccount *LinkedLedgerAccountInput `json:"ledger_account"` - // The customer this entity is linked to. - Customer *LinkedCustomerInput `json:"customer,omitempty"` - // The supplier this entity is linked to. - Supplier *LinkedSupplierInput `json:"supplier,omitempty"` - // The ID of the department - DepartmentID *string `json:"department_id,omitempty"` - // The ID of the location - LocationID *string `json:"location_id,omitempty"` - // Line number of the resource - LineNumber *int64 `json:"line_number,omitempty"` -} - -func (o *JournalEntryLineItemInput) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *JournalEntryLineItemInput) GetTaxAmount() *float64 { - if o == nil { - return nil - } - return o.TaxAmount -} - -func (o *JournalEntryLineItemInput) GetSubTotal() *float64 { - if o == nil { - return nil - } - return o.SubTotal -} - -func (o *JournalEntryLineItemInput) GetTotalAmount() *float64 { - if o == nil { - return nil - } - return o.TotalAmount -} - -func (o *JournalEntryLineItemInput) GetType() JournalEntryLineItemType { - if o == nil { - return JournalEntryLineItemType("") - } - return o.Type -} - -func (o *JournalEntryLineItemInput) GetTaxRate() *LinkedTaxRateInput { - if o == nil { - return nil - } - return o.TaxRate -} - -func (o *JournalEntryLineItemInput) GetTrackingCategory() *DeprecatedLinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategory -} - -func (o *JournalEntryLineItemInput) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *JournalEntryLineItemInput) GetLedgerAccount() *LinkedLedgerAccountInput { - if o == nil { - return nil - } - return o.LedgerAccount -} - -func (o *JournalEntryLineItemInput) GetCustomer() *LinkedCustomerInput { - if o == nil { - return nil - } - return o.Customer -} - -func (o *JournalEntryLineItemInput) GetSupplier() *LinkedSupplierInput { - if o == nil { - return nil - } - return o.Supplier -} - -func (o *JournalEntryLineItemInput) GetDepartmentID() *string { - if o == nil { - return nil - } - return o.DepartmentID -} - -func (o *JournalEntryLineItemInput) GetLocationID() *string { - if o == nil { - return nil - } - return o.LocationID -} - -func (o *JournalEntryLineItemInput) GetLineNumber() *int64 { - if o == nil { - return nil - } - return o.LineNumber -} diff --git a/tests/mockserver/internal/sdk/models/components/lead.go b/tests/mockserver/internal/sdk/models/components/lead.go deleted file mode 100644 index 1c6efc37..00000000 --- a/tests/mockserver/internal/sdk/models/components/lead.go +++ /dev/null @@ -1,259 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type Lead struct { - // Unique identifier for the contact. - ID *string `json:"id,omitempty"` - // Full name of the lead. - Name string `json:"name"` - // The name of the company the lead is associated with. - CompanyName *string `json:"company_name,omitempty"` - // The owner of the lead. - OwnerID *string `json:"owner_id,omitempty"` - // The name of the owner of the lead. - OwnerName *string `json:"owner_name,omitempty"` - // The company the lead is associated with. - CompanyID *string `json:"company_id,omitempty"` - // The identifier of the lead. - LeadID *string `json:"lead_id,omitempty"` - // The source of the lead. - LeadSource *string `json:"lead_source,omitempty"` - // The first name of the lead. - FirstName *string `json:"first_name,omitempty"` - // The last name of the lead. - LastName *string `json:"last_name,omitempty"` - // The description of the lead. - Description *string `json:"description,omitempty"` - // The prefix of the lead. - Prefix *string `json:"prefix,omitempty"` - // The job title of the lead. - Title *string `json:"title,omitempty"` - // language code according to ISO 639-1. For the United States - EN - Language *string `json:"language,omitempty"` - Status *string `json:"status,omitempty"` - // The monetary amount of the lead. - MonetaryAmount *float64 `json:"monetary_amount,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 fax number of the lead. - Fax *string `json:"fax,omitempty"` - Websites []Website `json:"websites,omitempty"` - Addresses []Address `json:"addresses,omitempty"` - SocialLinks []SocialLink `json:"social_links,omitempty"` - PhoneNumbers []PhoneNumber `json:"phone_numbers,omitempty"` - Emails []Email `json:"emails,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - Tags []string `json:"tags,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // Date updated in ISO 8601 format - UpdatedAt *string `json:"updated_at,omitempty"` - // Date created in ISO 8601 format - CreatedAt *string `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *Lead) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Lead) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *Lead) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *Lead) GetOwnerID() *string { - if o == nil { - return nil - } - return o.OwnerID -} - -func (o *Lead) GetOwnerName() *string { - if o == nil { - return nil - } - return o.OwnerName -} - -func (o *Lead) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *Lead) GetLeadID() *string { - if o == nil { - return nil - } - return o.LeadID -} - -func (o *Lead) GetLeadSource() *string { - if o == nil { - return nil - } - return o.LeadSource -} - -func (o *Lead) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *Lead) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *Lead) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *Lead) GetPrefix() *string { - if o == nil { - return nil - } - return o.Prefix -} - -func (o *Lead) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *Lead) GetLanguage() *string { - if o == nil { - return nil - } - return o.Language -} - -func (o *Lead) GetStatus() *string { - if o == nil { - return nil - } - return o.Status -} - -func (o *Lead) GetMonetaryAmount() *float64 { - if o == nil { - return nil - } - return o.MonetaryAmount -} - -func (o *Lead) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *Lead) GetFax() *string { - if o == nil { - return nil - } - return o.Fax -} - -func (o *Lead) GetWebsites() []Website { - if o == nil { - return nil - } - return o.Websites -} - -func (o *Lead) GetAddresses() []Address { - if o == nil { - return nil - } - return o.Addresses -} - -func (o *Lead) GetSocialLinks() []SocialLink { - if o == nil { - return nil - } - return o.SocialLinks -} - -func (o *Lead) GetPhoneNumbers() []PhoneNumber { - if o == nil { - return nil - } - return o.PhoneNumbers -} - -func (o *Lead) GetEmails() []Email { - if o == nil { - return nil - } - return o.Emails -} - -func (o *Lead) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *Lead) GetTags() []string { - if o == nil { - return nil - } - return o.Tags -} - -func (o *Lead) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Lead) GetUpdatedAt() *string { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Lead) GetCreatedAt() *string { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Lead) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/leadinput.go b/tests/mockserver/internal/sdk/models/components/leadinput.go deleted file mode 100644 index f7deb777..00000000 --- a/tests/mockserver/internal/sdk/models/components/leadinput.go +++ /dev/null @@ -1,223 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type LeadInput struct { - // Full name of the lead. - Name string `json:"name"` - // The name of the company the lead is associated with. - CompanyName *string `json:"company_name,omitempty"` - // The owner of the lead. - OwnerID *string `json:"owner_id,omitempty"` - // The name of the owner of the lead. - OwnerName *string `json:"owner_name,omitempty"` - // The company the lead is associated with. - CompanyID *string `json:"company_id,omitempty"` - // The identifier of the lead. - LeadID *string `json:"lead_id,omitempty"` - // The source of the lead. - LeadSource *string `json:"lead_source,omitempty"` - // The first name of the lead. - FirstName *string `json:"first_name,omitempty"` - // The last name of the lead. - LastName *string `json:"last_name,omitempty"` - // The description of the lead. - Description *string `json:"description,omitempty"` - // The prefix of the lead. - Prefix *string `json:"prefix,omitempty"` - // The job title of the lead. - Title *string `json:"title,omitempty"` - // language code according to ISO 639-1. For the United States - EN - Language *string `json:"language,omitempty"` - Status *string `json:"status,omitempty"` - // The monetary amount of the lead. - MonetaryAmount *float64 `json:"monetary_amount,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 fax number of the lead. - Fax *string `json:"fax,omitempty"` - Websites []Website `json:"websites,omitempty"` - Addresses []Address `json:"addresses,omitempty"` - SocialLinks []SocialLink `json:"social_links,omitempty"` - PhoneNumbers []PhoneNumber `json:"phone_numbers,omitempty"` - Emails []Email `json:"emails,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - Tags []string `json:"tags,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *LeadInput) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *LeadInput) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *LeadInput) GetOwnerID() *string { - if o == nil { - return nil - } - return o.OwnerID -} - -func (o *LeadInput) GetOwnerName() *string { - if o == nil { - return nil - } - return o.OwnerName -} - -func (o *LeadInput) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *LeadInput) GetLeadID() *string { - if o == nil { - return nil - } - return o.LeadID -} - -func (o *LeadInput) GetLeadSource() *string { - if o == nil { - return nil - } - return o.LeadSource -} - -func (o *LeadInput) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *LeadInput) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *LeadInput) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *LeadInput) GetPrefix() *string { - if o == nil { - return nil - } - return o.Prefix -} - -func (o *LeadInput) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *LeadInput) GetLanguage() *string { - if o == nil { - return nil - } - return o.Language -} - -func (o *LeadInput) GetStatus() *string { - if o == nil { - return nil - } - return o.Status -} - -func (o *LeadInput) GetMonetaryAmount() *float64 { - if o == nil { - return nil - } - return o.MonetaryAmount -} - -func (o *LeadInput) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *LeadInput) GetFax() *string { - if o == nil { - return nil - } - return o.Fax -} - -func (o *LeadInput) GetWebsites() []Website { - if o == nil { - return nil - } - return o.Websites -} - -func (o *LeadInput) GetAddresses() []Address { - if o == nil { - return nil - } - return o.Addresses -} - -func (o *LeadInput) GetSocialLinks() []SocialLink { - if o == nil { - return nil - } - return o.SocialLinks -} - -func (o *LeadInput) GetPhoneNumbers() []PhoneNumber { - if o == nil { - return nil - } - return o.PhoneNumbers -} - -func (o *LeadInput) GetEmails() []Email { - if o == nil { - return nil - } - return o.Emails -} - -func (o *LeadInput) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *LeadInput) GetTags() []string { - if o == nil { - return nil - } - return o.Tags -} - -func (o *LeadInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/leadsfilter.go b/tests/mockserver/internal/sdk/models/components/leadsfilter.go deleted file mode 100644 index 5999d6a3..00000000 --- a/tests/mockserver/internal/sdk/models/components/leadsfilter.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type LeadsFilter struct { - // Name of the lead to filter on - Name *string `queryParam:"name=name"` - // First name of the lead to filter on - FirstName *string `queryParam:"name=first_name"` - // Last name of the lead to filter on - LastName *string `queryParam:"name=last_name"` - // E-mail of the lead to filter on - Email *string `queryParam:"name=email"` - // Phone number of the lead to filter on - PhoneNumber *string `queryParam:"name=phone_number"` -} - -func (o *LeadsFilter) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *LeadsFilter) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *LeadsFilter) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *LeadsFilter) GetEmail() *string { - if o == nil { - return nil - } - return o.Email -} - -func (o *LeadsFilter) GetPhoneNumber() *string { - if o == nil { - return nil - } - return o.PhoneNumber -} diff --git a/tests/mockserver/internal/sdk/models/components/leadssort.go b/tests/mockserver/internal/sdk/models/components/leadssort.go deleted file mode 100644 index 58fa4b23..00000000 --- a/tests/mockserver/internal/sdk/models/components/leadssort.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// LeadsSortBy - The field on which to sort the Leads -type LeadsSortBy string - -const ( - LeadsSortByCreatedAt LeadsSortBy = "created_at" - LeadsSortByUpdatedAt LeadsSortBy = "updated_at" - LeadsSortByName LeadsSortBy = "name" - LeadsSortByFirstName LeadsSortBy = "first_name" - LeadsSortByLastName LeadsSortBy = "last_name" - LeadsSortByEmail LeadsSortBy = "email" -) - -func (e LeadsSortBy) ToPointer() *LeadsSortBy { - return &e -} -func (e *LeadsSortBy) 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": - fallthrough - case "name": - fallthrough - case "first_name": - fallthrough - case "last_name": - fallthrough - case "email": - *e = LeadsSortBy(v) - return nil - default: - return fmt.Errorf("invalid value for LeadsSortBy: %v", v) - } -} - -type LeadsSort struct { - // The field on which to sort the Leads - By *LeadsSortBy `queryParam:"name=by"` - // The direction in which to sort the results - Direction *SortDirection `default:"asc" queryParam:"name=direction"` -} - -func (l LeadsSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(l, "", false) -} - -func (l *LeadsSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { - return err - } - return nil -} - -func (o *LeadsSort) GetBy() *LeadsSortBy { - if o == nil { - return nil - } - return o.By -} - -func (o *LeadsSort) GetDirection() *SortDirection { - if o == nil { - return nil - } - return o.Direction -} diff --git a/tests/mockserver/internal/sdk/models/components/ledgeraccount.go b/tests/mockserver/internal/sdk/models/components/ledgeraccount.go deleted file mode 100644 index 10af5be6..00000000 --- a/tests/mockserver/internal/sdk/models/components/ledgeraccount.go +++ /dev/null @@ -1,818 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/types" - "mockserver/internal/sdk/utils" - "time" -) - -// LedgerAccountClassification - The classification of account. -type LedgerAccountClassification string - -const ( - LedgerAccountClassificationAsset LedgerAccountClassification = "asset" - LedgerAccountClassificationEquity LedgerAccountClassification = "equity" - LedgerAccountClassificationExpense LedgerAccountClassification = "expense" - LedgerAccountClassificationLiability LedgerAccountClassification = "liability" - LedgerAccountClassificationRevenue LedgerAccountClassification = "revenue" - LedgerAccountClassificationIncome LedgerAccountClassification = "income" - LedgerAccountClassificationOtherIncome LedgerAccountClassification = "other_income" - LedgerAccountClassificationOtherExpense LedgerAccountClassification = "other_expense" - LedgerAccountClassificationCostsOfSales LedgerAccountClassification = "costs_of_sales" - LedgerAccountClassificationOther LedgerAccountClassification = "other" -) - -func (e LedgerAccountClassification) ToPointer() *LedgerAccountClassification { - return &e -} -func (e *LedgerAccountClassification) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "asset": - fallthrough - case "equity": - fallthrough - case "expense": - fallthrough - case "liability": - fallthrough - case "revenue": - fallthrough - case "income": - fallthrough - case "other_income": - fallthrough - case "other_expense": - fallthrough - case "costs_of_sales": - fallthrough - case "other": - *e = LedgerAccountClassification(v) - return nil - default: - return fmt.Errorf("invalid value for LedgerAccountClassification: %v", v) - } -} - -// LedgerAccountType - The type of account. -type LedgerAccountType string - -const ( - LedgerAccountTypeAccountsReceivable LedgerAccountType = "accounts_receivable" - LedgerAccountTypeRevenue LedgerAccountType = "revenue" - LedgerAccountTypeSales LedgerAccountType = "sales" - LedgerAccountTypeOtherIncome LedgerAccountType = "other_income" - LedgerAccountTypeBank LedgerAccountType = "bank" - LedgerAccountTypeCurrentAsset LedgerAccountType = "current_asset" - LedgerAccountTypeFixedAsset LedgerAccountType = "fixed_asset" - LedgerAccountTypeNonCurrentAsset LedgerAccountType = "non_current_asset" - LedgerAccountTypeOtherAsset LedgerAccountType = "other_asset" - LedgerAccountTypeBalancesheet LedgerAccountType = "balancesheet" - LedgerAccountTypeEquity LedgerAccountType = "equity" - LedgerAccountTypeExpense LedgerAccountType = "expense" - LedgerAccountTypeOtherExpense LedgerAccountType = "other_expense" - LedgerAccountTypeCostsOfSales LedgerAccountType = "costs_of_sales" - LedgerAccountTypeAccountsPayable LedgerAccountType = "accounts_payable" - LedgerAccountTypeCreditCard LedgerAccountType = "credit_card" - LedgerAccountTypeCurrentLiability LedgerAccountType = "current_liability" - LedgerAccountTypeNonCurrentLiability LedgerAccountType = "non_current_liability" - LedgerAccountTypeOtherLiability LedgerAccountType = "other_liability" - LedgerAccountTypeOther LedgerAccountType = "other" -) - -func (e LedgerAccountType) ToPointer() *LedgerAccountType { - return &e -} -func (e *LedgerAccountType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "accounts_receivable": - fallthrough - case "revenue": - fallthrough - case "sales": - fallthrough - case "other_income": - fallthrough - case "bank": - fallthrough - case "current_asset": - fallthrough - case "fixed_asset": - fallthrough - case "non_current_asset": - fallthrough - case "other_asset": - fallthrough - case "balancesheet": - fallthrough - case "equity": - fallthrough - case "expense": - fallthrough - case "other_expense": - fallthrough - case "costs_of_sales": - fallthrough - case "accounts_payable": - fallthrough - case "credit_card": - fallthrough - case "current_liability": - fallthrough - case "non_current_liability": - fallthrough - case "other_liability": - fallthrough - case "other": - *e = LedgerAccountType(v) - return nil - default: - return fmt.Errorf("invalid value for LedgerAccountType: %v", v) - } -} - -// AccountStatus - The status of the account. -type AccountStatus string - -const ( - AccountStatusActive AccountStatus = "active" - AccountStatusInactive AccountStatus = "inactive" - AccountStatusArchived AccountStatus = "archived" -) - -func (e AccountStatus) ToPointer() *AccountStatus { - return &e -} -func (e *AccountStatus) 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 "archived": - *e = AccountStatus(v) - return nil - default: - return fmt.Errorf("invalid value for AccountStatus: %v", v) - } -} - -type LedgerAccountCategory struct { - ID *string `json:"id,omitempty"` - // The name of the category. - Name *string `json:"name,omitempty"` -} - -func (o *LedgerAccountCategory) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *LedgerAccountCategory) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -type ParentAccount struct { - // The ID of the parent account. - ID *string `json:"id,omitempty"` - // The name of the parent account. - Name *string `json:"name,omitempty"` - // The human readable display ID used when displaying the parent account - DisplayID *string `json:"display_id,omitempty"` -} - -func (o *ParentAccount) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *ParentAccount) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *ParentAccount) GetDisplayID() *string { - if o == nil { - return nil - } - return o.DisplayID -} - -type SubAccount struct { - // The ID of the sub account. - ID *string `json:"id,omitempty"` - // The name of the sub account. - AccountSubName *string `json:"account_sub_name,omitempty"` -} - -func (o *SubAccount) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *SubAccount) GetAccountSubName() *string { - if o == nil { - return nil - } - return o.AccountSubName -} - -type LedgerAccountSubsidiary struct { - // The ID of the subsidiary. - ID *string `json:"id,omitempty"` -} - -func (o *LedgerAccountSubsidiary) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -type LedgerAccount struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The human readable display ID used when displaying the account - DisplayID *string `json:"display_id,omitempty"` - // The nominal code of the ledger account. - // - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - NominalCode *string `json:"nominal_code,omitempty"` - // The code assigned to the account. - Code *string `json:"code,omitempty"` - // The classification of account. - Classification *LedgerAccountClassification `json:"classification,omitempty"` - // The type of account. - Type *LedgerAccountType `json:"type,omitempty"` - // The sub type of account. - SubType *string `json:"sub_type,omitempty"` - // The name of the account. - Name *string `json:"name,omitempty"` - // The fully qualified name of the account. - FullyQualifiedName *string `json:"fully_qualified_name,omitempty"` - // The description of the account. - Description *string `json:"description,omitempty"` - // The opening balance of the account. - OpeningBalance *float64 `json:"opening_balance,omitempty"` - // The current balance of the account. - CurrentBalance *float64 `json:"current_balance,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 tax type of the account. - TaxType *string `json:"tax_type,omitempty"` - TaxRate *LinkedTaxRate `json:"tax_rate,omitempty"` - Level *float64 `json:"level,omitempty"` - // Whether the account is active or not. - Active *bool `json:"active,omitempty"` - // The status of the account. - Status *AccountStatus `json:"status,omitempty"` - // Whether the account is a header or not. - Header *bool `json:"header,omitempty"` - BankAccount *BankAccount `json:"bank_account,omitempty"` - // The categories of the account. - Categories []LedgerAccountCategory `json:"categories,omitempty"` - ParentAccount *ParentAccount `json:"parent_account,omitempty"` - // Whether the account is a sub account or not. - SubAccount *bool `json:"sub_account,omitempty"` - // The sub accounts of the account. - SubAccounts []SubAccount `json:"sub_accounts,omitempty"` - // Reconciliation Date means the last calendar day of each Reconciliation Period. - LastReconciliationDate *types.Date `json:"last_reconciliation_date,omitempty"` - // The subsidiaries the account belongs to. - Subsidiaries []LedgerAccountSubsidiary `json:"subsidiaries,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (l LedgerAccount) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(l, "", false) -} - -func (l *LedgerAccount) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { - return err - } - return nil -} - -func (o *LedgerAccount) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *LedgerAccount) GetDisplayID() *string { - if o == nil { - return nil - } - return o.DisplayID -} - -func (o *LedgerAccount) GetNominalCode() *string { - if o == nil { - return nil - } - return o.NominalCode -} - -func (o *LedgerAccount) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *LedgerAccount) GetClassification() *LedgerAccountClassification { - if o == nil { - return nil - } - return o.Classification -} - -func (o *LedgerAccount) GetType() *LedgerAccountType { - if o == nil { - return nil - } - return o.Type -} - -func (o *LedgerAccount) GetSubType() *string { - if o == nil { - return nil - } - return o.SubType -} - -func (o *LedgerAccount) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *LedgerAccount) GetFullyQualifiedName() *string { - if o == nil { - return nil - } - return o.FullyQualifiedName -} - -func (o *LedgerAccount) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *LedgerAccount) GetOpeningBalance() *float64 { - if o == nil { - return nil - } - return o.OpeningBalance -} - -func (o *LedgerAccount) GetCurrentBalance() *float64 { - if o == nil { - return nil - } - return o.CurrentBalance -} - -func (o *LedgerAccount) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *LedgerAccount) GetTaxType() *string { - if o == nil { - return nil - } - return o.TaxType -} - -func (o *LedgerAccount) GetTaxRate() *LinkedTaxRate { - if o == nil { - return nil - } - return o.TaxRate -} - -func (o *LedgerAccount) GetLevel() *float64 { - if o == nil { - return nil - } - return o.Level -} - -func (o *LedgerAccount) GetActive() *bool { - if o == nil { - return nil - } - return o.Active -} - -func (o *LedgerAccount) GetStatus() *AccountStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *LedgerAccount) GetHeader() *bool { - if o == nil { - return nil - } - return o.Header -} - -func (o *LedgerAccount) GetBankAccount() *BankAccount { - if o == nil { - return nil - } - return o.BankAccount -} - -func (o *LedgerAccount) GetCategories() []LedgerAccountCategory { - if o == nil { - return nil - } - return o.Categories -} - -func (o *LedgerAccount) GetParentAccount() *ParentAccount { - if o == nil { - return nil - } - return o.ParentAccount -} - -func (o *LedgerAccount) GetSubAccount() *bool { - if o == nil { - return nil - } - return o.SubAccount -} - -func (o *LedgerAccount) GetSubAccounts() []SubAccount { - if o == nil { - return nil - } - return o.SubAccounts -} - -func (o *LedgerAccount) GetLastReconciliationDate() *types.Date { - if o == nil { - return nil - } - return o.LastReconciliationDate -} - -func (o *LedgerAccount) GetSubsidiaries() []LedgerAccountSubsidiary { - if o == nil { - return nil - } - return o.Subsidiaries -} - -func (o *LedgerAccount) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *LedgerAccount) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *LedgerAccount) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *LedgerAccount) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *LedgerAccount) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *LedgerAccount) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *LedgerAccount) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *LedgerAccount) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type LedgerAccountInput struct { - // The human readable display ID used when displaying the account - DisplayID *string `json:"display_id,omitempty"` - // The nominal code of the ledger account. - // - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - NominalCode *string `json:"nominal_code,omitempty"` - // The code assigned to the account. - Code *string `json:"code,omitempty"` - // The classification of account. - Classification *LedgerAccountClassification `json:"classification,omitempty"` - // The type of account. - Type *LedgerAccountType `json:"type,omitempty"` - // The sub type of account. - SubType *string `json:"sub_type,omitempty"` - // The name of the account. - Name *string `json:"name,omitempty"` - // The fully qualified name of the account. - FullyQualifiedName *string `json:"fully_qualified_name,omitempty"` - // The description of the account. - Description *string `json:"description,omitempty"` - // The opening balance of the account. - OpeningBalance *float64 `json:"opening_balance,omitempty"` - // The current balance of the account. - CurrentBalance *float64 `json:"current_balance,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 tax type of the account. - TaxType *string `json:"tax_type,omitempty"` - TaxRate *LinkedTaxRateInput `json:"tax_rate,omitempty"` - Level *float64 `json:"level,omitempty"` - // Whether the account is active or not. - Active *bool `json:"active,omitempty"` - // The status of the account. - Status *AccountStatus `json:"status,omitempty"` - // Whether the account is a header or not. - Header *bool `json:"header,omitempty"` - BankAccount *BankAccount `json:"bank_account,omitempty"` - ParentAccount *ParentAccount `json:"parent_account,omitempty"` - // Whether the account is a sub account or not. - SubAccount *bool `json:"sub_account,omitempty"` - // Reconciliation Date means the last calendar day of each Reconciliation Period. - LastReconciliationDate *types.Date `json:"last_reconciliation_date,omitempty"` - // The subsidiaries the account belongs to. - Subsidiaries []LedgerAccountSubsidiary `json:"subsidiaries,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (l LedgerAccountInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(l, "", false) -} - -func (l *LedgerAccountInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { - return err - } - return nil -} - -func (o *LedgerAccountInput) GetDisplayID() *string { - if o == nil { - return nil - } - return o.DisplayID -} - -func (o *LedgerAccountInput) GetNominalCode() *string { - if o == nil { - return nil - } - return o.NominalCode -} - -func (o *LedgerAccountInput) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *LedgerAccountInput) GetClassification() *LedgerAccountClassification { - if o == nil { - return nil - } - return o.Classification -} - -func (o *LedgerAccountInput) GetType() *LedgerAccountType { - if o == nil { - return nil - } - return o.Type -} - -func (o *LedgerAccountInput) GetSubType() *string { - if o == nil { - return nil - } - return o.SubType -} - -func (o *LedgerAccountInput) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *LedgerAccountInput) GetFullyQualifiedName() *string { - if o == nil { - return nil - } - return o.FullyQualifiedName -} - -func (o *LedgerAccountInput) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *LedgerAccountInput) GetOpeningBalance() *float64 { - if o == nil { - return nil - } - return o.OpeningBalance -} - -func (o *LedgerAccountInput) GetCurrentBalance() *float64 { - if o == nil { - return nil - } - return o.CurrentBalance -} - -func (o *LedgerAccountInput) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *LedgerAccountInput) GetTaxType() *string { - if o == nil { - return nil - } - return o.TaxType -} - -func (o *LedgerAccountInput) GetTaxRate() *LinkedTaxRateInput { - if o == nil { - return nil - } - return o.TaxRate -} - -func (o *LedgerAccountInput) GetLevel() *float64 { - if o == nil { - return nil - } - return o.Level -} - -func (o *LedgerAccountInput) GetActive() *bool { - if o == nil { - return nil - } - return o.Active -} - -func (o *LedgerAccountInput) GetStatus() *AccountStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *LedgerAccountInput) GetHeader() *bool { - if o == nil { - return nil - } - return o.Header -} - -func (o *LedgerAccountInput) GetBankAccount() *BankAccount { - if o == nil { - return nil - } - return o.BankAccount -} - -func (o *LedgerAccountInput) GetParentAccount() *ParentAccount { - if o == nil { - return nil - } - return o.ParentAccount -} - -func (o *LedgerAccountInput) GetSubAccount() *bool { - if o == nil { - return nil - } - return o.SubAccount -} - -func (o *LedgerAccountInput) GetLastReconciliationDate() *types.Date { - if o == nil { - return nil - } - return o.LastReconciliationDate -} - -func (o *LedgerAccountInput) GetSubsidiaries() []LedgerAccountSubsidiary { - if o == nil { - return nil - } - return o.Subsidiaries -} - -func (o *LedgerAccountInput) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *LedgerAccountInput) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *LedgerAccountInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/ledgeraccountsfilter.go b/tests/mockserver/internal/sdk/models/components/ledgeraccountsfilter.go deleted file mode 100644 index 3884b730..00000000 --- a/tests/mockserver/internal/sdk/models/components/ledgeraccountsfilter.go +++ /dev/null @@ -1,92 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// LedgerAccountsFilterClassification - Filter by account classification. -type LedgerAccountsFilterClassification string - -const ( - LedgerAccountsFilterClassificationAsset LedgerAccountsFilterClassification = "asset" - LedgerAccountsFilterClassificationEquity LedgerAccountsFilterClassification = "equity" - LedgerAccountsFilterClassificationExpense LedgerAccountsFilterClassification = "expense" - LedgerAccountsFilterClassificationLiability LedgerAccountsFilterClassification = "liability" - LedgerAccountsFilterClassificationRevenue LedgerAccountsFilterClassification = "revenue" - LedgerAccountsFilterClassificationIncome LedgerAccountsFilterClassification = "income" - LedgerAccountsFilterClassificationOtherIncome LedgerAccountsFilterClassification = "other_income" - LedgerAccountsFilterClassificationOtherExpense LedgerAccountsFilterClassification = "other_expense" - LedgerAccountsFilterClassificationCostsOfSales LedgerAccountsFilterClassification = "costs_of_sales" - LedgerAccountsFilterClassificationOther LedgerAccountsFilterClassification = "other" -) - -func (e LedgerAccountsFilterClassification) ToPointer() *LedgerAccountsFilterClassification { - return &e -} -func (e *LedgerAccountsFilterClassification) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "asset": - fallthrough - case "equity": - fallthrough - case "expense": - fallthrough - case "liability": - fallthrough - case "revenue": - fallthrough - case "income": - fallthrough - case "other_income": - fallthrough - case "other_expense": - fallthrough - case "costs_of_sales": - fallthrough - case "other": - *e = LedgerAccountsFilterClassification(v) - return nil - default: - return fmt.Errorf("invalid value for LedgerAccountsFilterClassification: %v", v) - } -} - -type LedgerAccountsFilter struct { - UpdatedSince *time.Time `queryParam:"name=updated_since"` - // Filter by account classification. - Classification *LedgerAccountsFilterClassification `queryParam:"name=classification"` -} - -func (l LedgerAccountsFilter) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(l, "", false) -} - -func (l *LedgerAccountsFilter) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { - return err - } - return nil -} - -func (o *LedgerAccountsFilter) GetUpdatedSince() *time.Time { - if o == nil { - return nil - } - return o.UpdatedSince -} - -func (o *LedgerAccountsFilter) GetClassification() *LedgerAccountsFilterClassification { - if o == nil { - return nil - } - return o.Classification -} diff --git a/tests/mockserver/internal/sdk/models/components/ledgeraccountssort.go b/tests/mockserver/internal/sdk/models/components/ledgeraccountssort.go deleted file mode 100644 index cb499da9..00000000 --- a/tests/mockserver/internal/sdk/models/components/ledgeraccountssort.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// LedgerAccountsSortBy - The field on which to sort the Ledger Accounts -type LedgerAccountsSortBy string - -const ( - LedgerAccountsSortByCreatedAt LedgerAccountsSortBy = "created_at" - LedgerAccountsSortByUpdatedAt LedgerAccountsSortBy = "updated_at" -) - -func (e LedgerAccountsSortBy) ToPointer() *LedgerAccountsSortBy { - return &e -} -func (e *LedgerAccountsSortBy) 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 = LedgerAccountsSortBy(v) - return nil - default: - return fmt.Errorf("invalid value for LedgerAccountsSortBy: %v", v) - } -} - -type LedgerAccountsSort struct { - // The field on which to sort the Ledger Accounts - By *LedgerAccountsSortBy `queryParam:"name=by"` - // The direction in which to sort the results - Direction *SortDirection `default:"asc" queryParam:"name=direction"` -} - -func (l LedgerAccountsSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(l, "", false) -} - -func (l *LedgerAccountsSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { - return err - } - return nil -} - -func (o *LedgerAccountsSort) GetBy() *LedgerAccountsSortBy { - if o == nil { - return nil - } - return o.By -} - -func (o *LedgerAccountsSort) GetDirection() *SortDirection { - if o == nil { - return nil - } - return o.Direction -} diff --git a/tests/mockserver/internal/sdk/models/components/linkedconnectorresource.go b/tests/mockserver/internal/sdk/models/components/linkedconnectorresource.go deleted file mode 100644 index 21bebb23..00000000 --- a/tests/mockserver/internal/sdk/models/components/linkedconnectorresource.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type LinkedConnectorResource struct { - // ID of the resource, typically a lowercased version of name. - ID *string `json:"id,omitempty"` - // Name of the resource (plural) - Name *string `json:"name,omitempty"` - // Status of the resource. Resources with status live or beta are callable. - Status *ResourceStatus `json:"status,omitempty"` - // ID of the resource in the Connector's API (downstream) - DownstreamID *string `json:"downstream_id,omitempty"` - // Name of the resource in the Connector's API (downstream) - DownstreamName *string `json:"downstream_name,omitempty"` -} - -func (o *LinkedConnectorResource) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *LinkedConnectorResource) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *LinkedConnectorResource) GetStatus() *ResourceStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *LinkedConnectorResource) GetDownstreamID() *string { - if o == nil { - return nil - } - return o.DownstreamID -} - -func (o *LinkedConnectorResource) GetDownstreamName() *string { - if o == nil { - return nil - } - return o.DownstreamName -} diff --git a/tests/mockserver/internal/sdk/models/components/linkedcustomer.go b/tests/mockserver/internal/sdk/models/components/linkedcustomer.go deleted file mode 100644 index 49d0af1d..00000000 --- a/tests/mockserver/internal/sdk/models/components/linkedcustomer.go +++ /dev/null @@ -1,63 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// LinkedCustomer - The customer this entity is linked to. -type LinkedCustomer struct { - // The ID of the customer this entity is linked to. - ID *string `json:"id,omitempty"` - // The display ID of the customer. - DisplayID *string `json:"display_id,omitempty"` - // The display name of the customer. - DisplayName *string `json:"display_name,omitempty"` - // The name of the customer. Deprecated, use display_name instead. - // - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - Name *string `json:"name,omitempty"` - // The company name of the customer. - CompanyName *string `json:"company_name,omitempty"` - // The email address of the customer. - Email *string `json:"email,omitempty"` -} - -func (o *LinkedCustomer) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *LinkedCustomer) GetDisplayID() *string { - if o == nil { - return nil - } - return o.DisplayID -} - -func (o *LinkedCustomer) GetDisplayName() *string { - if o == nil { - return nil - } - return o.DisplayName -} - -func (o *LinkedCustomer) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *LinkedCustomer) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *LinkedCustomer) GetEmail() *string { - if o == nil { - return nil - } - return o.Email -} diff --git a/tests/mockserver/internal/sdk/models/components/linkedcustomerinput.go b/tests/mockserver/internal/sdk/models/components/linkedcustomerinput.go deleted file mode 100644 index 8a6aa44a..00000000 --- a/tests/mockserver/internal/sdk/models/components/linkedcustomerinput.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// LinkedCustomerInput - The customer this entity is linked to. -type LinkedCustomerInput struct { - // The ID of the customer this entity is linked to. - ID *string `json:"id,omitempty"` - // The display name of the customer. - DisplayName *string `json:"display_name,omitempty"` - // The name of the customer. Deprecated, use display_name instead. - // - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - Name *string `json:"name,omitempty"` - // The email address of the customer. - Email *string `json:"email,omitempty"` -} - -func (o *LinkedCustomerInput) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *LinkedCustomerInput) GetDisplayName() *string { - if o == nil { - return nil - } - return o.DisplayName -} - -func (o *LinkedCustomerInput) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *LinkedCustomerInput) GetEmail() *string { - if o == nil { - return nil - } - return o.Email -} diff --git a/tests/mockserver/internal/sdk/models/components/linkedecommercecustomer.go b/tests/mockserver/internal/sdk/models/components/linkedecommercecustomer.go deleted file mode 100644 index 109e97c2..00000000 --- a/tests/mockserver/internal/sdk/models/components/linkedecommercecustomer.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// LinkedEcommerceCustomer - The customer this entity is linked to. -type LinkedEcommerceCustomer struct { - // The ID of the customer this entity is linked to. - ID *string `json:"id,omitempty"` - // Full name of the customer - Name *string `json:"name,omitempty"` - // First name of the customer - FirstName *string `json:"first_name,omitempty"` - // Last name of the customer - LastName *string `json:"last_name,omitempty"` - // Company name of the customer - CompanyName *string `json:"company_name,omitempty"` - PhoneNumbers []PhoneNumber `json:"phone_numbers,omitempty"` - Emails []Email `json:"emails,omitempty"` -} - -func (o *LinkedEcommerceCustomer) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *LinkedEcommerceCustomer) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *LinkedEcommerceCustomer) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *LinkedEcommerceCustomer) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *LinkedEcommerceCustomer) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *LinkedEcommerceCustomer) GetPhoneNumbers() []PhoneNumber { - if o == nil { - return nil - } - return o.PhoneNumbers -} - -func (o *LinkedEcommerceCustomer) GetEmails() []Email { - if o == nil { - return nil - } - return o.Emails -} diff --git a/tests/mockserver/internal/sdk/models/components/linkedecommerceorder.go b/tests/mockserver/internal/sdk/models/components/linkedecommerceorder.go deleted file mode 100644 index 77908701..00000000 --- a/tests/mockserver/internal/sdk/models/components/linkedecommerceorder.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// LinkedEcommerceOrder - The order this entity is linked to. -type LinkedEcommerceOrder struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The total amount of the order. - Total *string `json:"total,omitempty"` - // Current status of the order. - Status *EcommerceOrderStatus `json:"status,omitempty"` -} - -func (o *LinkedEcommerceOrder) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *LinkedEcommerceOrder) GetTotal() *string { - if o == nil { - return nil - } - return o.Total -} - -func (o *LinkedEcommerceOrder) GetStatus() *EcommerceOrderStatus { - if o == nil { - return nil - } - return o.Status -} diff --git a/tests/mockserver/internal/sdk/models/components/linkedfolder.go b/tests/mockserver/internal/sdk/models/components/linkedfolder.go deleted file mode 100644 index bb921da2..00000000 --- a/tests/mockserver/internal/sdk/models/components/linkedfolder.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type LinkedFolder struct { - // A unique identifier for an object. - ID string `json:"id"` - // The name of the folder - Name *string `json:"name,omitempty"` -} - -func (o *LinkedFolder) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *LinkedFolder) GetName() *string { - if o == nil { - return nil - } - return o.Name -} diff --git a/tests/mockserver/internal/sdk/models/components/linkedinvoiceitem.go b/tests/mockserver/internal/sdk/models/components/linkedinvoiceitem.go deleted file mode 100644 index ce605d85..00000000 --- a/tests/mockserver/internal/sdk/models/components/linkedinvoiceitem.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type LinkedInvoiceItem struct { - // ID of the linked item. A reference to the [invoice item](https://developers.apideck.com/apis/accounting/reference#tag/Invoice-Items) that was used to create this line item - ID *string `json:"id,omitempty"` - // User defined item code - Code *string `json:"code,omitempty"` - // User defined item name - Name *string `json:"name,omitempty"` -} - -func (o *LinkedInvoiceItem) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *LinkedInvoiceItem) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *LinkedInvoiceItem) GetName() *string { - if o == nil { - return nil - } - return o.Name -} diff --git a/tests/mockserver/internal/sdk/models/components/linkedledgeraccount.go b/tests/mockserver/internal/sdk/models/components/linkedledgeraccount.go deleted file mode 100644 index d1c471eb..00000000 --- a/tests/mockserver/internal/sdk/models/components/linkedledgeraccount.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type LinkedLedgerAccount struct { - // The unique identifier for the account. - ID *string `json:"id,omitempty"` - // The name of the account. - Name *string `json:"name,omitempty"` - // The nominal code of the account. - NominalCode *string `json:"nominal_code,omitempty"` - // The code assigned to the account. - Code *string `json:"code,omitempty"` -} - -func (o *LinkedLedgerAccount) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *LinkedLedgerAccount) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *LinkedLedgerAccount) GetNominalCode() *string { - if o == nil { - return nil - } - return o.NominalCode -} - -func (o *LinkedLedgerAccount) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} diff --git a/tests/mockserver/internal/sdk/models/components/linkedledgeraccountinput.go b/tests/mockserver/internal/sdk/models/components/linkedledgeraccountinput.go deleted file mode 100644 index 6804daf6..00000000 --- a/tests/mockserver/internal/sdk/models/components/linkedledgeraccountinput.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type LinkedLedgerAccountInput struct { - // The unique identifier for the account. - ID *string `json:"id,omitempty"` - // The nominal code of the account. - NominalCode *string `json:"nominal_code,omitempty"` - // The code assigned to the account. - Code *string `json:"code,omitempty"` -} - -func (o *LinkedLedgerAccountInput) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *LinkedLedgerAccountInput) GetNominalCode() *string { - if o == nil { - return nil - } - return o.NominalCode -} - -func (o *LinkedLedgerAccountInput) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} diff --git a/tests/mockserver/internal/sdk/models/components/linkedparentcustomer.go b/tests/mockserver/internal/sdk/models/components/linkedparentcustomer.go deleted file mode 100644 index f568cfb4..00000000 --- a/tests/mockserver/internal/sdk/models/components/linkedparentcustomer.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// LinkedParentCustomer - The parent customer this entity is linked to. -type LinkedParentCustomer struct { - // The parent ID of the customer this entity is linked to. - ID string `json:"id"` - // The name of the parent customer. - Name *string `json:"name,omitempty"` -} - -func (o *LinkedParentCustomer) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *LinkedParentCustomer) GetName() *string { - if o == nil { - return nil - } - return o.Name -} diff --git a/tests/mockserver/internal/sdk/models/components/linkedsupplier.go b/tests/mockserver/internal/sdk/models/components/linkedsupplier.go deleted file mode 100644 index 7c3f761d..00000000 --- a/tests/mockserver/internal/sdk/models/components/linkedsupplier.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// LinkedSupplier - The supplier this entity is linked to. -type LinkedSupplier struct { - // The ID of the supplier this entity is linked to. - ID *string `json:"id,omitempty"` - // The display ID of the supplier. - DisplayID *string `json:"display_id,omitempty"` - // The display name of the supplier. - DisplayName *string `json:"display_name,omitempty"` - // The company name of the supplier. - CompanyName *string `json:"company_name,omitempty"` - Address *Address `json:"address,omitempty"` -} - -func (o *LinkedSupplier) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *LinkedSupplier) GetDisplayID() *string { - if o == nil { - return nil - } - return o.DisplayID -} - -func (o *LinkedSupplier) GetDisplayName() *string { - if o == nil { - return nil - } - return o.DisplayName -} - -func (o *LinkedSupplier) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *LinkedSupplier) GetAddress() *Address { - if o == nil { - return nil - } - return o.Address -} diff --git a/tests/mockserver/internal/sdk/models/components/linkedsupplierinput.go b/tests/mockserver/internal/sdk/models/components/linkedsupplierinput.go deleted file mode 100644 index 201ef97e..00000000 --- a/tests/mockserver/internal/sdk/models/components/linkedsupplierinput.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// LinkedSupplierInput - The supplier this entity is linked to. -type LinkedSupplierInput struct { - // The ID of the supplier this entity is linked to. - ID *string `json:"id,omitempty"` - // The display name of the supplier. - DisplayName *string `json:"display_name,omitempty"` - Address *Address `json:"address,omitempty"` -} - -func (o *LinkedSupplierInput) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *LinkedSupplierInput) GetDisplayName() *string { - if o == nil { - return nil - } - return o.DisplayName -} - -func (o *LinkedSupplierInput) GetAddress() *Address { - if o == nil { - return nil - } - return o.Address -} diff --git a/tests/mockserver/internal/sdk/models/components/linkedtaxrate.go b/tests/mockserver/internal/sdk/models/components/linkedtaxrate.go deleted file mode 100644 index f7a07230..00000000 --- a/tests/mockserver/internal/sdk/models/components/linkedtaxrate.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type LinkedTaxRate struct { - // The ID of the object. - ID *string `json:"id,omitempty"` - // Tax rate code - Code *string `json:"code,omitempty"` - // Name of the tax rate - Name *string `json:"name,omitempty"` - // Rate of the tax rate - Rate *float64 `json:"rate,omitempty"` -} - -func (o *LinkedTaxRate) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *LinkedTaxRate) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *LinkedTaxRate) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *LinkedTaxRate) GetRate() *float64 { - if o == nil { - return nil - } - return o.Rate -} diff --git a/tests/mockserver/internal/sdk/models/components/linkedtaxrateinput.go b/tests/mockserver/internal/sdk/models/components/linkedtaxrateinput.go deleted file mode 100644 index e33be280..00000000 --- a/tests/mockserver/internal/sdk/models/components/linkedtaxrateinput.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type LinkedTaxRateInput struct { - // The ID of the object. - ID *string `json:"id,omitempty"` - // Rate of the tax rate - Rate *float64 `json:"rate,omitempty"` -} - -func (o *LinkedTaxRateInput) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *LinkedTaxRateInput) GetRate() *float64 { - if o == nil { - return nil - } - return o.Rate -} diff --git a/tests/mockserver/internal/sdk/models/components/linkedtrackingcategory.go b/tests/mockserver/internal/sdk/models/components/linkedtrackingcategory.go deleted file mode 100644 index b07e7769..00000000 --- a/tests/mockserver/internal/sdk/models/components/linkedtrackingcategory.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type LinkedTrackingCategory struct { - // The unique identifier for the tracking category. - ID *string `json:"id,omitempty"` - // The name of the tracking category. - Name *string `json:"name,omitempty"` -} - -func (o *LinkedTrackingCategory) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *LinkedTrackingCategory) GetName() *string { - if o == nil { - return nil - } - return o.Name -} diff --git a/tests/mockserver/internal/sdk/models/components/links.go b/tests/mockserver/internal/sdk/models/components/links.go deleted file mode 100644 index 829b2497..00000000 --- a/tests/mockserver/internal/sdk/models/components/links.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// Links to navigate to previous or next pages through the API -type Links struct { - // Link to navigate to the previous page through the API - Previous *string `json:"previous,omitempty"` - // Link to navigate to the current page through the API - Current *string `json:"current,omitempty"` - // Link to navigate to the previous page through the API - Next *string `json:"next,omitempty"` -} - -func (o *Links) GetPrevious() *string { - if o == nil { - return nil - } - return o.Previous -} - -func (o *Links) GetCurrent() *string { - if o == nil { - return nil - } - return o.Current -} - -func (o *Links) GetNext() *string { - if o == nil { - return nil - } - return o.Next -} diff --git a/tests/mockserver/internal/sdk/models/components/log.go b/tests/mockserver/internal/sdk/models/components/log.go deleted file mode 100644 index 8f2e7ae6..00000000 --- a/tests/mockserver/internal/sdk/models/components/log.go +++ /dev/null @@ -1,301 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// Operation - The request as defined in OpenApi Spec. -type Operation struct { - // The OpenApi Operation Id associated with the request - ID string `json:"id"` - // The OpenApi Operation name associated with the request - Name string `json:"name"` -} - -func (o *Operation) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *Operation) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -// LogService - Apideck service provider associated with request. -type LogService struct { - // Apideck service provider id. - ID string `json:"id"` - // Apideck service provider name. - Name string `json:"name"` -} - -func (o *LogService) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *LogService) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -// UnifiedAPIEnum - Which Unified Api request was made to. -type UnifiedAPIEnum string - -const ( - UnifiedAPIEnumCrm UnifiedAPIEnum = "crm" - UnifiedAPIEnumLead UnifiedAPIEnum = "lead" - UnifiedAPIEnumProxy UnifiedAPIEnum = "proxy" - UnifiedAPIEnumVault UnifiedAPIEnum = "vault" - UnifiedAPIEnumAccounting UnifiedAPIEnum = "accounting" - UnifiedAPIEnumHris UnifiedAPIEnum = "hris" - UnifiedAPIEnumAts UnifiedAPIEnum = "ats" - UnifiedAPIEnumEcommerce UnifiedAPIEnum = "ecommerce" - UnifiedAPIEnumIssueTracking UnifiedAPIEnum = "issue-tracking" - UnifiedAPIEnumPos UnifiedAPIEnum = "pos" - UnifiedAPIEnumFileStorage UnifiedAPIEnum = "file-storage" - UnifiedAPIEnumSms UnifiedAPIEnum = "sms" -) - -func (e UnifiedAPIEnum) ToPointer() *UnifiedAPIEnum { - return &e -} -func (e *UnifiedAPIEnum) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "crm": - fallthrough - case "lead": - fallthrough - case "proxy": - fallthrough - case "vault": - fallthrough - case "accounting": - fallthrough - case "hris": - fallthrough - case "ats": - fallthrough - case "ecommerce": - fallthrough - case "issue-tracking": - fallthrough - case "pos": - fallthrough - case "file-storage": - fallthrough - case "sms": - *e = UnifiedAPIEnum(v) - return nil - default: - return fmt.Errorf("invalid value for UnifiedAPIEnum: %v", v) - } -} - -type Log struct { - // Indicates if the request was made via REST or Graphql endpoint. - APIStyle string `json:"api_style"` - // The Apideck base URL the request was made to. - BaseURL string `json:"base_url"` - // Indicates whether or not this is a child or parent request. - ChildRequest bool `json:"child_request"` - // The consumer Id associated with the request. - ConsumerID string `json:"consumer_id"` - // The entire execution time in milliseconds it took to call the Apideck service provider. - Duration float64 `json:"duration"` - // If error occurred, this is brief explanation - ErrorMessage *string `json:"error_message,omitempty"` - // The entire execution time in milliseconds it took to make the request. - Execution int64 `json:"execution"` - // When request is a parent request, this indicates if there are child requests associated. - HasChildren bool `json:"has_children"` - // HTTP Method of request. - HTTPMethod string `json:"http_method"` - // UUID acting as Request Identifier. - ID string `json:"id"` - // Latency added by making this request via Unified Api. - Latency float64 `json:"latency"` - // The request as defined in OpenApi Spec. - Operation Operation `json:"operation"` - // When request is a child request, this UUID indicates it's parent request. - ParentID *string `json:"parent_id"` - // The path component of the URI the request was made to. - Path string `json:"path"` - // Indicates whether the request was made using Apidecks sandbox credentials or not. - Sandbox bool `json:"sandbox"` - // Apideck service provider associated with request. - Service LogService `json:"service"` - // The IP address of the source of the request. - SourceIP *string `json:"source_ip,omitempty"` - // HTTP Status code that was returned. - StatusCode int64 `json:"status_code"` - // Whether or not the request was successful. - Success bool `json:"success"` - // ISO Date and time when the request was made. - Timestamp string `json:"timestamp"` - // Which Unified Api request was made to. - UnifiedAPI UnifiedAPIEnum `json:"unified_api"` -} - -func (o *Log) GetAPIStyle() string { - if o == nil { - return "" - } - return o.APIStyle -} - -func (o *Log) GetBaseURL() string { - if o == nil { - return "" - } - return o.BaseURL -} - -func (o *Log) GetChildRequest() bool { - if o == nil { - return false - } - return o.ChildRequest -} - -func (o *Log) GetConsumerID() string { - if o == nil { - return "" - } - return o.ConsumerID -} - -func (o *Log) GetDuration() float64 { - if o == nil { - return 0.0 - } - return o.Duration -} - -func (o *Log) GetErrorMessage() *string { - if o == nil { - return nil - } - return o.ErrorMessage -} - -func (o *Log) GetExecution() int64 { - if o == nil { - return 0 - } - return o.Execution -} - -func (o *Log) GetHasChildren() bool { - if o == nil { - return false - } - return o.HasChildren -} - -func (o *Log) GetHTTPMethod() string { - if o == nil { - return "" - } - return o.HTTPMethod -} - -func (o *Log) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *Log) GetLatency() float64 { - if o == nil { - return 0.0 - } - return o.Latency -} - -func (o *Log) GetOperation() Operation { - if o == nil { - return Operation{} - } - return o.Operation -} - -func (o *Log) GetParentID() *string { - if o == nil { - return nil - } - return o.ParentID -} - -func (o *Log) GetPath() string { - if o == nil { - return "" - } - return o.Path -} - -func (o *Log) GetSandbox() bool { - if o == nil { - return false - } - return o.Sandbox -} - -func (o *Log) GetService() LogService { - if o == nil { - return LogService{} - } - return o.Service -} - -func (o *Log) GetSourceIP() *string { - if o == nil { - return nil - } - return o.SourceIP -} - -func (o *Log) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *Log) GetSuccess() bool { - if o == nil { - return false - } - return o.Success -} - -func (o *Log) GetTimestamp() string { - if o == nil { - return "" - } - return o.Timestamp -} - -func (o *Log) GetUnifiedAPI() UnifiedAPIEnum { - if o == nil { - return UnifiedAPIEnum("") - } - return o.UnifiedAPI -} diff --git a/tests/mockserver/internal/sdk/models/components/logsfilter.go b/tests/mockserver/internal/sdk/models/components/logsfilter.go deleted file mode 100644 index d400063d..00000000 --- a/tests/mockserver/internal/sdk/models/components/logsfilter.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type LogsFilter struct { - ConnectorID *string `queryParam:"name=connector_id"` - StatusCode *float64 `queryParam:"name=status_code"` - ExcludeUnifiedApis *string `queryParam:"name=exclude_unified_apis"` -} - -func (o *LogsFilter) GetConnectorID() *string { - if o == nil { - return nil - } - return o.ConnectorID -} - -func (o *LogsFilter) GetStatusCode() *float64 { - if o == nil { - return nil - } - return o.StatusCode -} - -func (o *LogsFilter) GetExcludeUnifiedApis() *string { - if o == nil { - return nil - } - return o.ExcludeUnifiedApis -} diff --git a/tests/mockserver/internal/sdk/models/components/message.go b/tests/mockserver/internal/sdk/models/components/message.go deleted file mode 100644 index fc69336d..00000000 --- a/tests/mockserver/internal/sdk/models/components/message.go +++ /dev/null @@ -1,503 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// MessageType - Set to sms for SMS messages and mms for MMS messages. -type MessageType string - -const ( - MessageTypeSms MessageType = "sms" - MessageTypeMms MessageType = "mms" -) - -func (e MessageType) ToPointer() *MessageType { - return &e -} -func (e *MessageType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "sms": - fallthrough - case "mms": - *e = MessageType(v) - return nil - default: - return fmt.Errorf("invalid value for MessageType: %v", v) - } -} - -// Direction - The direction of the message. -type Direction string - -const ( - DirectionInbound Direction = "inbound" - DirectionOutboundAPI Direction = "outbound-api" - DirectionOutboundCall Direction = "outbound-call" - DirectionOutboundReply Direction = "outbound-reply" - DirectionUnknown Direction = "unknown" -) - -func (e Direction) ToPointer() *Direction { - return &e -} -func (e *Direction) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "inbound": - fallthrough - case "outbound-api": - fallthrough - case "outbound-call": - fallthrough - case "outbound-reply": - fallthrough - case "unknown": - *e = Direction(v) - return nil - default: - return fmt.Errorf("invalid value for Direction: %v", v) - } -} - -// MessageStatus - Status of the delivery of the message. -type MessageStatus string - -const ( - MessageStatusAccepted MessageStatus = "accepted" - MessageStatusScheduled MessageStatus = "scheduled" - MessageStatusCanceled MessageStatus = "canceled" - MessageStatusQueued MessageStatus = "queued" - MessageStatusSending MessageStatus = "sending" - MessageStatusSent MessageStatus = "sent" - MessageStatusFailed MessageStatus = "failed" - MessageStatusDelivered MessageStatus = "delivered" - MessageStatusUndelivered MessageStatus = "undelivered" - MessageStatusReceiving MessageStatus = "receiving" - MessageStatusReceived MessageStatus = "received" - MessageStatusRead MessageStatus = "read" -) - -func (e MessageStatus) ToPointer() *MessageStatus { - return &e -} -func (e *MessageStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "accepted": - fallthrough - case "scheduled": - fallthrough - case "canceled": - fallthrough - case "queued": - fallthrough - case "sending": - fallthrough - case "sent": - fallthrough - case "failed": - fallthrough - case "delivered": - fallthrough - case "undelivered": - fallthrough - case "receiving": - fallthrough - case "received": - fallthrough - case "read": - *e = MessageStatus(v) - return nil - default: - return fmt.Errorf("invalid value for MessageStatus: %v", v) - } -} - -// Price of the message. -type Price struct { - PerUnit *string `json:"per_unit,omitempty"` - TotalAmount *string `json:"total_amount,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"` -} - -func (o *Price) GetPerUnit() *string { - if o == nil { - return nil - } - return o.PerUnit -} - -func (o *Price) GetTotalAmount() *string { - if o == nil { - return nil - } - return o.TotalAmount -} - -func (o *Price) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -// Error - The error returned if your message status is failed or undelivered. -type Error struct { - // The error_code provides more information about the failure. If the message was successful, this value is null - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` -} - -func (o *Error) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *Error) GetMessage() *string { - if o == nil { - return nil - } - return o.Message -} - -type Message struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The phone number that initiated the message. - From string `json:"from"` - // The phone number that received the message. - To string `json:"to"` - Subject *string `json:"subject,omitempty"` - // The message text. - Body string `json:"body"` - // Set to sms for SMS messages and mms for MMS messages. - Type *MessageType `json:"type,omitempty"` - // The number of units that make up the complete message. Messages can be split up due to the constraints of the message size. - NumberOfUnits *int64 `json:"number_of_units,omitempty"` - // The number of media files associated with the message. - NumberOfMediaFiles *int64 `json:"number_of_media_files,omitempty"` - // The direction of the message. - Direction *Direction `json:"direction,omitempty"` - // Status of the delivery of the message. - Status *MessageStatus `json:"status,omitempty"` - // The scheduled date and time of the message. - ScheduledAt *time.Time `json:"scheduled_at,omitempty"` - // The date and time that the message was sent - SentAt *time.Time `json:"sent_at,omitempty"` - // Define a webhook to receive delivery notifications. - WebhookURL *string `json:"webhook_url,omitempty"` - // A client reference. - Reference *string `json:"reference,omitempty"` - // Price of the message. - Price *Price `json:"price,omitempty"` - // The error returned if your message status is failed or undelivered. - Error *Error `json:"error,omitempty"` - // The ID of the Messaging Service used with the message. In case of Plivo this links to the Powerpack ID. - MessagingServiceID *string `json:"messaging_service_id,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (m Message) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(m, "", false) -} - -func (m *Message) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &m, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Message) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Message) GetFrom() string { - if o == nil { - return "" - } - return o.From -} - -func (o *Message) GetTo() string { - if o == nil { - return "" - } - return o.To -} - -func (o *Message) GetSubject() *string { - if o == nil { - return nil - } - return o.Subject -} - -func (o *Message) GetBody() string { - if o == nil { - return "" - } - return o.Body -} - -func (o *Message) GetType() *MessageType { - if o == nil { - return nil - } - return o.Type -} - -func (o *Message) GetNumberOfUnits() *int64 { - if o == nil { - return nil - } - return o.NumberOfUnits -} - -func (o *Message) GetNumberOfMediaFiles() *int64 { - if o == nil { - return nil - } - return o.NumberOfMediaFiles -} - -func (o *Message) GetDirection() *Direction { - if o == nil { - return nil - } - return o.Direction -} - -func (o *Message) GetStatus() *MessageStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *Message) GetScheduledAt() *time.Time { - if o == nil { - return nil - } - return o.ScheduledAt -} - -func (o *Message) GetSentAt() *time.Time { - if o == nil { - return nil - } - return o.SentAt -} - -func (o *Message) GetWebhookURL() *string { - if o == nil { - return nil - } - return o.WebhookURL -} - -func (o *Message) GetReference() *string { - if o == nil { - return nil - } - return o.Reference -} - -func (o *Message) GetPrice() *Price { - if o == nil { - return nil - } - return o.Price -} - -func (o *Message) GetError() *Error { - if o == nil { - return nil - } - return o.Error -} - -func (o *Message) GetMessagingServiceID() *string { - if o == nil { - return nil - } - return o.MessagingServiceID -} - -func (o *Message) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Message) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *Message) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *Message) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Message) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Message) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type MessageInput struct { - // The phone number that initiated the message. - From string `json:"from"` - // The phone number that received the message. - To string `json:"to"` - Subject *string `json:"subject,omitempty"` - // The message text. - Body string `json:"body"` - // Set to sms for SMS messages and mms for MMS messages. - Type *MessageType `json:"type,omitempty"` - // The scheduled date and time of the message. - ScheduledAt *time.Time `json:"scheduled_at,omitempty"` - // Define a webhook to receive delivery notifications. - WebhookURL *string `json:"webhook_url,omitempty"` - // A client reference. - Reference *string `json:"reference,omitempty"` - // The ID of the Messaging Service used with the message. In case of Plivo this links to the Powerpack ID. - MessagingServiceID *string `json:"messaging_service_id,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (m MessageInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(m, "", false) -} - -func (m *MessageInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &m, "", false, false); err != nil { - return err - } - return nil -} - -func (o *MessageInput) GetFrom() string { - if o == nil { - return "" - } - return o.From -} - -func (o *MessageInput) GetTo() string { - if o == nil { - return "" - } - return o.To -} - -func (o *MessageInput) GetSubject() *string { - if o == nil { - return nil - } - return o.Subject -} - -func (o *MessageInput) GetBody() string { - if o == nil { - return "" - } - return o.Body -} - -func (o *MessageInput) GetType() *MessageType { - if o == nil { - return nil - } - return o.Type -} - -func (o *MessageInput) GetScheduledAt() *time.Time { - if o == nil { - return nil - } - return o.ScheduledAt -} - -func (o *MessageInput) GetWebhookURL() *string { - if o == nil { - return nil - } - return o.WebhookURL -} - -func (o *MessageInput) GetReference() *string { - if o == nil { - return nil - } - return o.Reference -} - -func (o *MessageInput) GetMessagingServiceID() *string { - if o == nil { - return nil - } - return o.MessagingServiceID -} - -func (o *MessageInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/meta.go b/tests/mockserver/internal/sdk/models/components/meta.go deleted file mode 100644 index b45f18c4..00000000 --- a/tests/mockserver/internal/sdk/models/components/meta.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// Cursors to navigate to previous or next pages through the API -type Cursors struct { - // Cursor to navigate to the previous page of results through the API - Previous *string `json:"previous,omitempty"` - // Cursor to navigate to the current page of results through the API - Current *string `json:"current,omitempty"` - // Cursor to navigate to the next page of results through the API - Next *string `json:"next,omitempty"` -} - -func (o *Cursors) GetPrevious() *string { - if o == nil { - return nil - } - return o.Previous -} - -func (o *Cursors) GetCurrent() *string { - if o == nil { - return nil - } - return o.Current -} - -func (o *Cursors) GetNext() *string { - if o == nil { - return nil - } - return o.Next -} - -// Meta - Response metadata -type Meta struct { - // Number of items returned in the data property of the response - ItemsOnPage *int64 `json:"items_on_page,omitempty"` - // Cursors to navigate to previous or next pages through the API - Cursors *Cursors `json:"cursors,omitempty"` -} - -func (o *Meta) GetItemsOnPage() *int64 { - if o == nil { - return nil - } - return o.ItemsOnPage -} - -func (o *Meta) GetCursors() *Cursors { - if o == nil { - return nil - } - return o.Cursors -} diff --git a/tests/mockserver/internal/sdk/models/components/note.go b/tests/mockserver/internal/sdk/models/components/note.go deleted file mode 100644 index ec0de24e..00000000 --- a/tests/mockserver/internal/sdk/models/components/note.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type Note struct { - // The unique identifier of the note - ID *string `json:"id,omitempty"` - // The title of the note - Title *string `json:"title,omitempty"` - // The content of the note. - Content *string `json:"content,omitempty"` - // The user that owns the note. - OwnerID *string `json:"owner_id,omitempty"` - // The contact that is related to the note. - ContactID *string `json:"contact_id,omitempty"` - // The company that is related to the note. - CompanyID *string `json:"company_id,omitempty"` - // The opportunity that is related to the note. - OpportunityID *string `json:"opportunity_id,omitempty"` - // The activity that is related to the note. - ActivityID *string `json:"activity_id,omitempty"` - // The lead that is related to the note. - LeadID *string `json:"lead_id,omitempty"` - // Whether the Note is active or not. - Active *bool `json:"active,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // The user that last updated the note. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user that created the note. - CreatedBy *string `json:"created_by,omitempty"` - // The timestamp when the note was last updated - UpdatedAt *string `json:"updated_at,omitempty"` - // The timestamp when the note was created - CreatedAt *string `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *Note) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Note) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *Note) GetContent() *string { - if o == nil { - return nil - } - return o.Content -} - -func (o *Note) GetOwnerID() *string { - if o == nil { - return nil - } - return o.OwnerID -} - -func (o *Note) GetContactID() *string { - if o == nil { - return nil - } - return o.ContactID -} - -func (o *Note) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *Note) GetOpportunityID() *string { - if o == nil { - return nil - } - return o.OpportunityID -} - -func (o *Note) GetActivityID() *string { - if o == nil { - return nil - } - return o.ActivityID -} - -func (o *Note) GetLeadID() *string { - if o == nil { - return nil - } - return o.LeadID -} - -func (o *Note) GetActive() *bool { - if o == nil { - return nil - } - return o.Active -} - -func (o *Note) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Note) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *Note) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *Note) GetUpdatedAt() *string { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Note) GetCreatedAt() *string { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Note) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/noteinput.go b/tests/mockserver/internal/sdk/models/components/noteinput.go deleted file mode 100644 index df4bcc76..00000000 --- a/tests/mockserver/internal/sdk/models/components/noteinput.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type NoteInput struct { - // The title of the note - Title *string `json:"title,omitempty"` - // The content of the note. - Content *string `json:"content,omitempty"` - // The user that owns the note. - OwnerID *string `json:"owner_id,omitempty"` - // The contact that is related to the note. - ContactID *string `json:"contact_id,omitempty"` - // The company that is related to the note. - CompanyID *string `json:"company_id,omitempty"` - // The opportunity that is related to the note. - OpportunityID *string `json:"opportunity_id,omitempty"` - // The activity that is related to the note. - ActivityID *string `json:"activity_id,omitempty"` - // The lead that is related to the note. - LeadID *string `json:"lead_id,omitempty"` - // Whether the Note is active or not. - Active *bool `json:"active,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *NoteInput) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *NoteInput) GetContent() *string { - if o == nil { - return nil - } - return o.Content -} - -func (o *NoteInput) GetOwnerID() *string { - if o == nil { - return nil - } - return o.OwnerID -} - -func (o *NoteInput) GetContactID() *string { - if o == nil { - return nil - } - return o.ContactID -} - -func (o *NoteInput) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *NoteInput) GetOpportunityID() *string { - if o == nil { - return nil - } - return o.OpportunityID -} - -func (o *NoteInput) GetActivityID() *string { - if o == nil { - return nil - } - return o.ActivityID -} - -func (o *NoteInput) GetLeadID() *string { - if o == nil { - return nil - } - return o.LeadID -} - -func (o *NoteInput) GetActive() *bool { - if o == nil { - return nil - } - return o.Active -} - -func (o *NoteInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/notfoundresponseerror.go b/tests/mockserver/internal/sdk/models/components/notfoundresponseerror.go deleted file mode 100644 index 00e254d7..00000000 --- a/tests/mockserver/internal/sdk/models/components/notfoundresponseerror.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "errors" - "fmt" - "mockserver/internal/sdk/utils" -) - -type NotFoundResponseDetailType string - -const ( - NotFoundResponseDetailTypeStr NotFoundResponseDetailType = "str" - NotFoundResponseDetailTypeMapOfAny NotFoundResponseDetailType = "mapOfAny" -) - -// NotFoundResponseDetail - Contains parameter or domain specific information related to the error and why it occurred. -type NotFoundResponseDetail struct { - Str *string `queryParam:"inline"` - MapOfAny map[string]any `queryParam:"inline"` - - Type NotFoundResponseDetailType -} - -func CreateNotFoundResponseDetailStr(str string) NotFoundResponseDetail { - typ := NotFoundResponseDetailTypeStr - - return NotFoundResponseDetail{ - Str: &str, - Type: typ, - } -} - -func CreateNotFoundResponseDetailMapOfAny(mapOfAny map[string]any) NotFoundResponseDetail { - typ := NotFoundResponseDetailTypeMapOfAny - - return NotFoundResponseDetail{ - MapOfAny: mapOfAny, - Type: typ, - } -} - -func (u *NotFoundResponseDetail) UnmarshalJSON(data []byte) error { - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = NotFoundResponseDetailTypeStr - return nil - } - - var mapOfAny map[string]any = map[string]any{} - if err := utils.UnmarshalJSON(data, &mapOfAny, "", true, true); err == nil { - u.MapOfAny = mapOfAny - u.Type = NotFoundResponseDetailTypeMapOfAny - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for NotFoundResponseDetail", string(data)) -} - -func (u NotFoundResponseDetail) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.MapOfAny != nil { - return utils.MarshalJSON(u.MapOfAny, "", true) - } - - return nil, errors.New("could not marshal union type NotFoundResponseDetail: all fields are null") -} diff --git a/tests/mockserver/internal/sdk/models/components/oauthgranttype.go b/tests/mockserver/internal/sdk/models/components/oauthgranttype.go deleted file mode 100644 index 840094f2..00000000 --- a/tests/mockserver/internal/sdk/models/components/oauthgranttype.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// OAuthGrantType - OAuth grant type used by the connector. More info: https://oauth.net/2/grant-types -type OAuthGrantType string - -const ( - OAuthGrantTypeAuthorizationCode OAuthGrantType = "authorization_code" - OAuthGrantTypeClientCredentials OAuthGrantType = "client_credentials" - OAuthGrantTypePassword OAuthGrantType = "password" -) - -func (e OAuthGrantType) ToPointer() *OAuthGrantType { - return &e -} -func (e *OAuthGrantType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "authorization_code": - fallthrough - case "client_credentials": - fallthrough - case "password": - *e = OAuthGrantType(v) - return nil - default: - return fmt.Errorf("invalid value for OAuthGrantType: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/opportunitiesfilter.go b/tests/mockserver/internal/sdk/models/components/opportunitiesfilter.go deleted file mode 100644 index 9123b543..00000000 --- a/tests/mockserver/internal/sdk/models/components/opportunitiesfilter.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type OpportunitiesFilter struct { - // Title of the opportunity to filter on - Title *string `queryParam:"name=title"` - // Status to filter on - Status *string `queryParam:"name=status"` - // Monetary amount to filter on - MonetaryAmount *float64 `queryParam:"name=monetary_amount"` - // Win probability to filter on - WinProbability *float64 `queryParam:"name=win_probability"` - // Company ID to filter on - CompanyID *string `queryParam:"name=company_id"` - // Owner ID to filter on - OwnerID *string `queryParam:"name=owner_id"` - // Primary contact ID to filter on - PrimaryContactID *string `queryParam:"name=primary_contact_id"` -} - -func (o *OpportunitiesFilter) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *OpportunitiesFilter) GetStatus() *string { - if o == nil { - return nil - } - return o.Status -} - -func (o *OpportunitiesFilter) GetMonetaryAmount() *float64 { - if o == nil { - return nil - } - return o.MonetaryAmount -} - -func (o *OpportunitiesFilter) GetWinProbability() *float64 { - if o == nil { - return nil - } - return o.WinProbability -} - -func (o *OpportunitiesFilter) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *OpportunitiesFilter) GetOwnerID() *string { - if o == nil { - return nil - } - return o.OwnerID -} - -func (o *OpportunitiesFilter) GetPrimaryContactID() *string { - if o == nil { - return nil - } - return o.PrimaryContactID -} diff --git a/tests/mockserver/internal/sdk/models/components/opportunitiessort.go b/tests/mockserver/internal/sdk/models/components/opportunitiessort.go deleted file mode 100644 index a904acbf..00000000 --- a/tests/mockserver/internal/sdk/models/components/opportunitiessort.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// OpportunitiesSortBy - The field on which to sort the Opportunities -type OpportunitiesSortBy string - -const ( - OpportunitiesSortByCreatedAt OpportunitiesSortBy = "created_at" - OpportunitiesSortByUpdatedAt OpportunitiesSortBy = "updated_at" - OpportunitiesSortByTitle OpportunitiesSortBy = "title" - OpportunitiesSortByWinProbability OpportunitiesSortBy = "win_probability" - OpportunitiesSortByMonetaryAmount OpportunitiesSortBy = "monetary_amount" - OpportunitiesSortByStatus OpportunitiesSortBy = "status" -) - -func (e OpportunitiesSortBy) ToPointer() *OpportunitiesSortBy { - return &e -} -func (e *OpportunitiesSortBy) 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": - fallthrough - case "title": - fallthrough - case "win_probability": - fallthrough - case "monetary_amount": - fallthrough - case "status": - *e = OpportunitiesSortBy(v) - return nil - default: - return fmt.Errorf("invalid value for OpportunitiesSortBy: %v", v) - } -} - -type OpportunitiesSort struct { - // The field on which to sort the Opportunities - By *OpportunitiesSortBy `queryParam:"name=by"` - // The direction in which to sort the results - Direction *SortDirection `default:"asc" queryParam:"name=direction"` -} - -func (o OpportunitiesSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(o, "", false) -} - -func (o *OpportunitiesSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &o, "", false, false); err != nil { - return err - } - return nil -} - -func (o *OpportunitiesSort) GetBy() *OpportunitiesSortBy { - if o == nil { - return nil - } - return o.By -} - -func (o *OpportunitiesSort) GetDirection() *SortDirection { - if o == nil { - return nil - } - return o.Direction -} diff --git a/tests/mockserver/internal/sdk/models/components/opportunity.go b/tests/mockserver/internal/sdk/models/components/opportunity.go deleted file mode 100644 index c0f5e807..00000000 --- a/tests/mockserver/internal/sdk/models/components/opportunity.go +++ /dev/null @@ -1,399 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/types" - "mockserver/internal/sdk/utils" - "time" -) - -type Opportunity struct { - // A unique identifier for the opportunity. - ID *string `json:"id,omitempty"` - // The title or name of the opportunity. - Title string `json:"title"` - // The unique identifier of the primary contact associated with the opportunity. - PrimaryContactID *string `json:"primary_contact_id,omitempty"` - // A description of the opportunity. - Description *string `json:"description,omitempty"` - // The type of the opportunity - Type *string `json:"type,omitempty"` - // The monetary value associated with the opportunity - MonetaryAmount *float64 `json:"monetary_amount,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 probability of winning the opportunity, expressed as a percentage. - WinProbability *float64 `json:"win_probability,omitempty"` - // The expected revenue from the opportunity - ExpectedRevenue *float64 `json:"expected_revenue,omitempty"` - // The actual closing date for the opportunity. If close_date is null, the opportunity is not closed yet. - CloseDate *types.Date `json:"close_date,omitempty"` - // The unique identifier of the reason why the opportunity was lost. - LossReasonID *string `json:"loss_reason_id,omitempty"` - // The reason why the opportunity was lost. - LossReason *string `json:"loss_reason,omitempty"` - // The unique identifier of the reason why the opportunity was won. - WonReasonID *string `json:"won_reason_id,omitempty"` - // The reason why the opportunity was won. - WonReason *string `json:"won_reason,omitempty"` - // The unique identifier of the pipeline associated with the opportunity - PipelineID *string `json:"pipeline_id,omitempty"` - // The unique identifier of the stage in the pipeline associated with the opportunity. - PipelineStageID *string `json:"pipeline_stage_id,omitempty"` - // The unique identifier of the source of the opportunity. - SourceID *string `json:"source_id,omitempty"` - // The unique identifier of the lead associated with the opportunity. - LeadID *string `json:"lead_id,omitempty"` - // The source of the lead associated with the opportunity. - LeadSource *string `json:"lead_source,omitempty"` - // The unique identifier of the contact associated with the opportunity. - ContactID *string `json:"contact_id,omitempty"` - // An array of unique identifiers of all contacts associated with the opportunity. - ContactIds []string `json:"contact_ids,omitempty"` - // The unique identifier of the company associated with the opportunity. - CompanyID *string `json:"company_id,omitempty"` - // The name of the company associated with the opportunity. - CompanyName *string `json:"company_name,omitempty"` - // The unique identifier of the user who owns the opportunity. - OwnerID *string `json:"owner_id,omitempty"` - // The priority level of the opportunity. - Priority *string `json:"priority,omitempty"` - // The current status of the opportunity. - Status *string `json:"status,omitempty"` - // The unique identifier of the current status of the opportunity. - StatusID *string `json:"status_id,omitempty"` - Tags []string `json:"tags,omitempty"` - // The number of interactions with the opportunity. - InteractionCount *float64 `json:"interaction_count,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // The date and time when the stage of the opportunity was last changed. - StageLastChangedAt *time.Time `json:"stage_last_changed_at,omitempty"` - // The date and time of the last activity associated with the opportunity. - LastActivityAt *string `json:"last_activity_at,omitempty"` - // Indicates whether the opportunity has been deleted. - Deleted *bool `json:"deleted,omitempty"` - // The date and time when the stage of the opportunity was last changed. - DateStageChanged *time.Time `json:"date_stage_changed,omitempty"` - // The date and time when the opportunity was last contacted. - DateLastContacted *time.Time `json:"date_last_contacted,omitempty"` - // The date and time when the lead associated with the opportunity was created. - DateLeadCreated *time.Time `json:"date_lead_created,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // The unique identifier of the user who last updated the opportunity. - UpdatedBy *string `json:"updated_by,omitempty"` - // The unique identifier of the user who created the opportunity. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the opportunity was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the opportunity was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o Opportunity) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(o, "", false) -} - -func (o *Opportunity) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &o, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Opportunity) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Opportunity) GetTitle() string { - if o == nil { - return "" - } - return o.Title -} - -func (o *Opportunity) GetPrimaryContactID() *string { - if o == nil { - return nil - } - return o.PrimaryContactID -} - -func (o *Opportunity) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *Opportunity) GetType() *string { - if o == nil { - return nil - } - return o.Type -} - -func (o *Opportunity) GetMonetaryAmount() *float64 { - if o == nil { - return nil - } - return o.MonetaryAmount -} - -func (o *Opportunity) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *Opportunity) GetWinProbability() *float64 { - if o == nil { - return nil - } - return o.WinProbability -} - -func (o *Opportunity) GetExpectedRevenue() *float64 { - if o == nil { - return nil - } - return o.ExpectedRevenue -} - -func (o *Opportunity) GetCloseDate() *types.Date { - if o == nil { - return nil - } - return o.CloseDate -} - -func (o *Opportunity) GetLossReasonID() *string { - if o == nil { - return nil - } - return o.LossReasonID -} - -func (o *Opportunity) GetLossReason() *string { - if o == nil { - return nil - } - return o.LossReason -} - -func (o *Opportunity) GetWonReasonID() *string { - if o == nil { - return nil - } - return o.WonReasonID -} - -func (o *Opportunity) GetWonReason() *string { - if o == nil { - return nil - } - return o.WonReason -} - -func (o *Opportunity) GetPipelineID() *string { - if o == nil { - return nil - } - return o.PipelineID -} - -func (o *Opportunity) GetPipelineStageID() *string { - if o == nil { - return nil - } - return o.PipelineStageID -} - -func (o *Opportunity) GetSourceID() *string { - if o == nil { - return nil - } - return o.SourceID -} - -func (o *Opportunity) GetLeadID() *string { - if o == nil { - return nil - } - return o.LeadID -} - -func (o *Opportunity) GetLeadSource() *string { - if o == nil { - return nil - } - return o.LeadSource -} - -func (o *Opportunity) GetContactID() *string { - if o == nil { - return nil - } - return o.ContactID -} - -func (o *Opportunity) GetContactIds() []string { - if o == nil { - return nil - } - return o.ContactIds -} - -func (o *Opportunity) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *Opportunity) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *Opportunity) GetOwnerID() *string { - if o == nil { - return nil - } - return o.OwnerID -} - -func (o *Opportunity) GetPriority() *string { - if o == nil { - return nil - } - return o.Priority -} - -func (o *Opportunity) GetStatus() *string { - if o == nil { - return nil - } - return o.Status -} - -func (o *Opportunity) GetStatusID() *string { - if o == nil { - return nil - } - return o.StatusID -} - -func (o *Opportunity) GetTags() []string { - if o == nil { - return nil - } - return o.Tags -} - -func (o *Opportunity) GetInteractionCount() *float64 { - if o == nil { - return nil - } - return o.InteractionCount -} - -func (o *Opportunity) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *Opportunity) GetStageLastChangedAt() *time.Time { - if o == nil { - return nil - } - return o.StageLastChangedAt -} - -func (o *Opportunity) GetLastActivityAt() *string { - if o == nil { - return nil - } - return o.LastActivityAt -} - -func (o *Opportunity) GetDeleted() *bool { - if o == nil { - return nil - } - return o.Deleted -} - -func (o *Opportunity) GetDateStageChanged() *time.Time { - if o == nil { - return nil - } - return o.DateStageChanged -} - -func (o *Opportunity) GetDateLastContacted() *time.Time { - if o == nil { - return nil - } - return o.DateLastContacted -} - -func (o *Opportunity) GetDateLeadCreated() *time.Time { - if o == nil { - return nil - } - return o.DateLeadCreated -} - -func (o *Opportunity) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Opportunity) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *Opportunity) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *Opportunity) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Opportunity) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Opportunity) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/opportunityinput.go b/tests/mockserver/internal/sdk/models/components/opportunityinput.go deleted file mode 100644 index c7644016..00000000 --- a/tests/mockserver/internal/sdk/models/components/opportunityinput.go +++ /dev/null @@ -1,282 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/types" - "mockserver/internal/sdk/utils" - "time" -) - -type OpportunityInput struct { - // The title or name of the opportunity. - Title string `json:"title"` - // The unique identifier of the primary contact associated with the opportunity. - PrimaryContactID *string `json:"primary_contact_id,omitempty"` - // A description of the opportunity. - Description *string `json:"description,omitempty"` - // The type of the opportunity - Type *string `json:"type,omitempty"` - // The monetary value associated with the opportunity - MonetaryAmount *float64 `json:"monetary_amount,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 probability of winning the opportunity, expressed as a percentage. - WinProbability *float64 `json:"win_probability,omitempty"` - // The actual closing date for the opportunity. If close_date is null, the opportunity is not closed yet. - CloseDate *types.Date `json:"close_date,omitempty"` - // The unique identifier of the reason why the opportunity was lost. - LossReasonID *string `json:"loss_reason_id,omitempty"` - // The reason why the opportunity was lost. - LossReason *string `json:"loss_reason,omitempty"` - // The unique identifier of the reason why the opportunity was won. - WonReasonID *string `json:"won_reason_id,omitempty"` - // The reason why the opportunity was won. - WonReason *string `json:"won_reason,omitempty"` - // The unique identifier of the pipeline associated with the opportunity - PipelineID *string `json:"pipeline_id,omitempty"` - // The unique identifier of the stage in the pipeline associated with the opportunity. - PipelineStageID *string `json:"pipeline_stage_id,omitempty"` - // The unique identifier of the source of the opportunity. - SourceID *string `json:"source_id,omitempty"` - // The unique identifier of the lead associated with the opportunity. - LeadID *string `json:"lead_id,omitempty"` - // The source of the lead associated with the opportunity. - LeadSource *string `json:"lead_source,omitempty"` - // The unique identifier of the contact associated with the opportunity. - ContactID *string `json:"contact_id,omitempty"` - // An array of unique identifiers of all contacts associated with the opportunity. - ContactIds []string `json:"contact_ids,omitempty"` - // The unique identifier of the company associated with the opportunity. - CompanyID *string `json:"company_id,omitempty"` - // The name of the company associated with the opportunity. - CompanyName *string `json:"company_name,omitempty"` - // The unique identifier of the user who owns the opportunity. - OwnerID *string `json:"owner_id,omitempty"` - // The priority level of the opportunity. - Priority *string `json:"priority,omitempty"` - // The current status of the opportunity. - Status *string `json:"status,omitempty"` - // The unique identifier of the current status of the opportunity. - StatusID *string `json:"status_id,omitempty"` - Tags []string `json:"tags,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // The date and time when the stage of the opportunity was last changed. - StageLastChangedAt *time.Time `json:"stage_last_changed_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o OpportunityInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(o, "", false) -} - -func (o *OpportunityInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &o, "", false, false); err != nil { - return err - } - return nil -} - -func (o *OpportunityInput) GetTitle() string { - if o == nil { - return "" - } - return o.Title -} - -func (o *OpportunityInput) GetPrimaryContactID() *string { - if o == nil { - return nil - } - return o.PrimaryContactID -} - -func (o *OpportunityInput) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *OpportunityInput) GetType() *string { - if o == nil { - return nil - } - return o.Type -} - -func (o *OpportunityInput) GetMonetaryAmount() *float64 { - if o == nil { - return nil - } - return o.MonetaryAmount -} - -func (o *OpportunityInput) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *OpportunityInput) GetWinProbability() *float64 { - if o == nil { - return nil - } - return o.WinProbability -} - -func (o *OpportunityInput) GetCloseDate() *types.Date { - if o == nil { - return nil - } - return o.CloseDate -} - -func (o *OpportunityInput) GetLossReasonID() *string { - if o == nil { - return nil - } - return o.LossReasonID -} - -func (o *OpportunityInput) GetLossReason() *string { - if o == nil { - return nil - } - return o.LossReason -} - -func (o *OpportunityInput) GetWonReasonID() *string { - if o == nil { - return nil - } - return o.WonReasonID -} - -func (o *OpportunityInput) GetWonReason() *string { - if o == nil { - return nil - } - return o.WonReason -} - -func (o *OpportunityInput) GetPipelineID() *string { - if o == nil { - return nil - } - return o.PipelineID -} - -func (o *OpportunityInput) GetPipelineStageID() *string { - if o == nil { - return nil - } - return o.PipelineStageID -} - -func (o *OpportunityInput) GetSourceID() *string { - if o == nil { - return nil - } - return o.SourceID -} - -func (o *OpportunityInput) GetLeadID() *string { - if o == nil { - return nil - } - return o.LeadID -} - -func (o *OpportunityInput) GetLeadSource() *string { - if o == nil { - return nil - } - return o.LeadSource -} - -func (o *OpportunityInput) GetContactID() *string { - if o == nil { - return nil - } - return o.ContactID -} - -func (o *OpportunityInput) GetContactIds() []string { - if o == nil { - return nil - } - return o.ContactIds -} - -func (o *OpportunityInput) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *OpportunityInput) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *OpportunityInput) GetOwnerID() *string { - if o == nil { - return nil - } - return o.OwnerID -} - -func (o *OpportunityInput) GetPriority() *string { - if o == nil { - return nil - } - return o.Priority -} - -func (o *OpportunityInput) GetStatus() *string { - if o == nil { - return nil - } - return o.Status -} - -func (o *OpportunityInput) GetStatusID() *string { - if o == nil { - return nil - } - return o.StatusID -} - -func (o *OpportunityInput) GetTags() []string { - if o == nil { - return nil - } - return o.Tags -} - -func (o *OpportunityInput) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *OpportunityInput) GetStageLastChangedAt() *time.Time { - if o == nil { - return nil - } - return o.StageLastChangedAt -} - -func (o *OpportunityInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/orderssort.go b/tests/mockserver/internal/sdk/models/components/orderssort.go deleted file mode 100644 index aaf997fb..00000000 --- a/tests/mockserver/internal/sdk/models/components/orderssort.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// OrdersSortBy - The field on which to sort the Orders -type OrdersSortBy string - -const ( - OrdersSortByCreatedAt OrdersSortBy = "created_at" - OrdersSortByUpdatedAt OrdersSortBy = "updated_at" - OrdersSortByName OrdersSortBy = "name" -) - -func (e OrdersSortBy) ToPointer() *OrdersSortBy { - return &e -} -func (e *OrdersSortBy) 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": - fallthrough - case "name": - *e = OrdersSortBy(v) - return nil - default: - return fmt.Errorf("invalid value for OrdersSortBy: %v", v) - } -} - -type OrdersSort struct { - // The field on which to sort the Orders - By *OrdersSortBy `queryParam:"name=by"` - // The direction in which to sort the results - Direction *SortDirection `default:"asc" queryParam:"name=direction"` -} - -func (o OrdersSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(o, "", false) -} - -func (o *OrdersSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &o, "", false, false); err != nil { - return err - } - return nil -} - -func (o *OrdersSort) GetBy() *OrdersSortBy { - if o == nil { - return nil - } - return o.By -} - -func (o *OrdersSort) GetDirection() *SortDirection { - if o == nil { - return nil - } - return o.Direction -} diff --git a/tests/mockserver/internal/sdk/models/components/outstandingbalancebycurrency.go b/tests/mockserver/internal/sdk/models/components/outstandingbalancebycurrency.go deleted file mode 100644 index fb258ad5..00000000 --- a/tests/mockserver/internal/sdk/models/components/outstandingbalancebycurrency.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type OutstandingBalanceByCurrency struct { - // 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"` - // Total amount of the outstanding balance. - TotalAmount *float64 `json:"total_amount,omitempty"` - BalancesByPeriod []BalanceByPeriod `json:"balances_by_period,omitempty"` -} - -func (o *OutstandingBalanceByCurrency) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *OutstandingBalanceByCurrency) GetTotalAmount() *float64 { - if o == nil { - return nil - } - return o.TotalAmount -} - -func (o *OutstandingBalanceByCurrency) GetBalancesByPeriod() []BalanceByPeriod { - if o == nil { - return nil - } - return o.BalancesByPeriod -} diff --git a/tests/mockserver/internal/sdk/models/components/outstandingbalancebycustomer.go b/tests/mockserver/internal/sdk/models/components/outstandingbalancebycustomer.go deleted file mode 100644 index aec598f4..00000000 --- a/tests/mockserver/internal/sdk/models/components/outstandingbalancebycustomer.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type OutstandingBalanceByCustomer struct { - // Unique identifier for the customer. - CustomerID *string `json:"customer_id,omitempty"` - // Full name of the customer. - CustomerName *string `json:"customer_name,omitempty"` - OutstandingBalancesByCurrency []OutstandingBalanceByCurrency `json:"outstanding_balances_by_currency,omitempty"` -} - -func (o *OutstandingBalanceByCustomer) GetCustomerID() *string { - if o == nil { - return nil - } - return o.CustomerID -} - -func (o *OutstandingBalanceByCustomer) GetCustomerName() *string { - if o == nil { - return nil - } - return o.CustomerName -} - -func (o *OutstandingBalanceByCustomer) GetOutstandingBalancesByCurrency() []OutstandingBalanceByCurrency { - if o == nil { - return nil - } - return o.OutstandingBalancesByCurrency -} diff --git a/tests/mockserver/internal/sdk/models/components/outstandingbalancebysupplier.go b/tests/mockserver/internal/sdk/models/components/outstandingbalancebysupplier.go deleted file mode 100644 index 60a16986..00000000 --- a/tests/mockserver/internal/sdk/models/components/outstandingbalancebysupplier.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type OutstandingBalanceBySupplier struct { - // Unique identifier for the supplier. - SupplierID *string `json:"supplier_id,omitempty"` - // Full name of the supplier. - SupplierName *string `json:"supplier_name,omitempty"` - OutstandingBalancesByCurrency []OutstandingBalanceByCurrency `json:"outstanding_balances_by_currency,omitempty"` -} - -func (o *OutstandingBalanceBySupplier) GetSupplierID() *string { - if o == nil { - return nil - } - return o.SupplierID -} - -func (o *OutstandingBalanceBySupplier) GetSupplierName() *string { - if o == nil { - return nil - } - return o.SupplierName -} - -func (o *OutstandingBalanceBySupplier) GetOutstandingBalancesByCurrency() []OutstandingBalanceByCurrency { - if o == nil { - return nil - } - return o.OutstandingBalancesByCurrency -} diff --git a/tests/mockserver/internal/sdk/models/components/owner.go b/tests/mockserver/internal/sdk/models/components/owner.go deleted file mode 100644 index 58787b69..00000000 --- a/tests/mockserver/internal/sdk/models/components/owner.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type Owner struct { - // ID of the owner - ID *string `json:"id,omitempty"` - // Email of the owner - Email *string `json:"email,omitempty"` - // Name of the owner - Name *string `json:"name,omitempty"` -} - -func (o *Owner) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Owner) GetEmail() *string { - if o == nil { - return nil - } - return o.Email -} - -func (o *Owner) GetName() *string { - if o == nil { - return nil - } - return o.Name -} diff --git a/tests/mockserver/internal/sdk/models/components/paginationcoverage.go b/tests/mockserver/internal/sdk/models/components/paginationcoverage.go deleted file mode 100644 index 10286dfe..00000000 --- a/tests/mockserver/internal/sdk/models/components/paginationcoverage.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// PaginationCoverageMode - How pagination is implemented on this connector. Native mode means Apideck is using the pagination parameters of the connector. With virtual pagination, the connector does not support pagination, but Apideck emulates it. -type PaginationCoverageMode string - -const ( - PaginationCoverageModeNative PaginationCoverageMode = "native" - PaginationCoverageModeVirtual PaginationCoverageMode = "virtual" -) - -func (e PaginationCoverageMode) ToPointer() *PaginationCoverageMode { - return &e -} -func (e *PaginationCoverageMode) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "native": - fallthrough - case "virtual": - *e = PaginationCoverageMode(v) - return nil - default: - return fmt.Errorf("invalid value for PaginationCoverageMode: %v", v) - } -} - -type PaginationCoverage struct { - // How pagination is implemented on this connector. Native mode means Apideck is using the pagination parameters of the connector. With virtual pagination, the connector does not support pagination, but Apideck emulates it. - Mode *PaginationCoverageMode `json:"mode,omitempty"` - // Indicates whether the connector supports paging through results using the cursor parameter. - PagingSupport *bool `json:"paging_support,omitempty"` - // Indicates whether the connector supports changing the page size by using the limit parameter. - LimitSupport *bool `json:"limit_support,omitempty"` -} - -func (o *PaginationCoverage) GetMode() *PaginationCoverageMode { - if o == nil { - return nil - } - return o.Mode -} - -func (o *PaginationCoverage) GetPagingSupport() *bool { - if o == nil { - return nil - } - return o.PagingSupport -} - -func (o *PaginationCoverage) GetLimitSupport() *bool { - if o == nil { - return nil - } - return o.LimitSupport -} diff --git a/tests/mockserver/internal/sdk/models/components/passthroughbody.go b/tests/mockserver/internal/sdk/models/components/passthroughbody.go deleted file mode 100644 index 8bdd0124..00000000 --- a/tests/mockserver/internal/sdk/models/components/passthroughbody.go +++ /dev/null @@ -1,63 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type ExtendPath struct { - // JSONPath string specifying where to apply the value. - Path string `json:"path"` - // The value to set at the specified path, can be any type. - Value any `json:"value"` -} - -func (o *ExtendPath) GetPath() string { - if o == nil { - return "" - } - return o.Path -} - -func (o *ExtendPath) GetValue() any { - if o == nil { - return nil - } - return o.Value -} - -type PassThroughBody struct { - // Identifier for the service to which this pass_through should be applied. - ServiceID string `json:"service_id"` - // Optional identifier for a workflow operation to which this pass_through should be applied. This is useful for Unify calls that are making more than one downstream request. - OperationID *string `json:"operation_id,omitempty"` - // Simple object allowing any properties for direct extension. - ExtendObject map[string]any `json:"extend_object,omitempty"` - // Array of objects for structured data modifications via paths. - ExtendPaths []ExtendPath `json:"extend_paths,omitempty"` -} - -func (o *PassThroughBody) GetServiceID() string { - if o == nil { - return "" - } - return o.ServiceID -} - -func (o *PassThroughBody) GetOperationID() *string { - if o == nil { - return nil - } - return o.OperationID -} - -func (o *PassThroughBody) GetExtendObject() map[string]any { - if o == nil { - return nil - } - return o.ExtendObject -} - -func (o *PassThroughBody) GetExtendPaths() []ExtendPath { - if o == nil { - return nil - } - return o.ExtendPaths -} diff --git a/tests/mockserver/internal/sdk/models/components/payment.go b/tests/mockserver/internal/sdk/models/components/payment.go deleted file mode 100644 index a235d525..00000000 --- a/tests/mockserver/internal/sdk/models/components/payment.go +++ /dev/null @@ -1,313 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type Payment struct { - // A unique identifier for an object. - ID string `json:"id"` - // The third-party API ID of original entity - DownstreamID *string `json:"downstream_id,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"` - // Currency Exchange Rate at the time entity was recorded/generated. - CurrencyRate *float64 `json:"currency_rate,omitempty"` - // The total amount of the transaction or record - TotalAmount *float64 `json:"total_amount"` - // Optional transaction reference message ie: Debit remittance detail. - Reference *string `json:"reference,omitempty"` - // Payment method used for the transaction, such as cash, credit card, bank transfer, or check - PaymentMethod *string `json:"payment_method,omitempty"` - // Optional reference message returned by payment method on processing - PaymentMethodReference *string `json:"payment_method_reference,omitempty"` - // A unique identifier for an object. - PaymentMethodID *string `json:"payment_method_id,omitempty"` - // Type of accounts receivable account. - // - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - AccountsReceivableAccountType *string `json:"accounts_receivable_account_type,omitempty"` - // Unique identifier for the account to allocate payment to. - // - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - AccountsReceivableAccountID *string `json:"accounts_receivable_account_id,omitempty"` - Account *LinkedLedgerAccount `json:"account,omitempty"` - // The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD - TransactionDate *time.Time `json:"transaction_date"` - // The customer this entity is linked to. - Customer *LinkedCustomer `json:"customer,omitempty"` - // The supplier this entity is linked to. - // - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - Supplier *DeprecatedLinkedSupplier `json:"supplier,omitempty"` - // The company or subsidiary id the transaction belongs to - CompanyID *string `json:"company_id,omitempty"` - // Indicates if the transaction has been reconciled. - Reconciled *bool `json:"reconciled,omitempty"` - // Status of payment - Status *PaymentStatus `json:"status,omitempty"` - // Type of payment - Type *PaymentType `json:"type,omitempty"` - Allocations []Allocation `json:"allocations,omitempty"` - // Note associated with the transaction - Note *string `json:"note,omitempty"` - // Number associated with the transaction - Number *string `json:"number,omitempty"` - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // Id to be displayed. - DisplayID *string `json:"display_id,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,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 pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (p Payment) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *Payment) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Payment) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *Payment) GetDownstreamID() *string { - if o == nil { - return nil - } - return o.DownstreamID -} - -func (o *Payment) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *Payment) GetCurrencyRate() *float64 { - if o == nil { - return nil - } - return o.CurrencyRate -} - -func (o *Payment) GetTotalAmount() *float64 { - if o == nil { - return nil - } - return o.TotalAmount -} - -func (o *Payment) GetReference() *string { - if o == nil { - return nil - } - return o.Reference -} - -func (o *Payment) GetPaymentMethod() *string { - if o == nil { - return nil - } - return o.PaymentMethod -} - -func (o *Payment) GetPaymentMethodReference() *string { - if o == nil { - return nil - } - return o.PaymentMethodReference -} - -func (o *Payment) GetPaymentMethodID() *string { - if o == nil { - return nil - } - return o.PaymentMethodID -} - -func (o *Payment) GetAccountsReceivableAccountType() *string { - if o == nil { - return nil - } - return o.AccountsReceivableAccountType -} - -func (o *Payment) GetAccountsReceivableAccountID() *string { - if o == nil { - return nil - } - return o.AccountsReceivableAccountID -} - -func (o *Payment) GetAccount() *LinkedLedgerAccount { - if o == nil { - return nil - } - return o.Account -} - -func (o *Payment) GetTransactionDate() *time.Time { - if o == nil { - return nil - } - return o.TransactionDate -} - -func (o *Payment) GetCustomer() *LinkedCustomer { - if o == nil { - return nil - } - return o.Customer -} - -func (o *Payment) GetSupplier() *DeprecatedLinkedSupplier { - if o == nil { - return nil - } - return o.Supplier -} - -func (o *Payment) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *Payment) GetReconciled() *bool { - if o == nil { - return nil - } - return o.Reconciled -} - -func (o *Payment) GetStatus() *PaymentStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *Payment) GetType() *PaymentType { - if o == nil { - return nil - } - return o.Type -} - -func (o *Payment) GetAllocations() []Allocation { - if o == nil { - return nil - } - return o.Allocations -} - -func (o *Payment) GetNote() *string { - if o == nil { - return nil - } - return o.Note -} - -func (o *Payment) GetNumber() *string { - if o == nil { - return nil - } - return o.Number -} - -func (o *Payment) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *Payment) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *Payment) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *Payment) GetDisplayID() *string { - if o == nil { - return nil - } - return o.DisplayID -} - -func (o *Payment) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Payment) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *Payment) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *Payment) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Payment) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Payment) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/paymentfrequency.go b/tests/mockserver/internal/sdk/models/components/paymentfrequency.go deleted file mode 100644 index 8fa11faa..00000000 --- a/tests/mockserver/internal/sdk/models/components/paymentfrequency.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// PaymentFrequency - Frequency of employee compensation. -type PaymentFrequency string - -const ( - PaymentFrequencyWeekly PaymentFrequency = "weekly" - PaymentFrequencyBiweekly PaymentFrequency = "biweekly" - PaymentFrequencyMonthly PaymentFrequency = "monthly" - PaymentFrequencyProRata PaymentFrequency = "pro-rata" - PaymentFrequencyOther PaymentFrequency = "other" -) - -func (e PaymentFrequency) ToPointer() *PaymentFrequency { - return &e -} -func (e *PaymentFrequency) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "weekly": - fallthrough - case "biweekly": - fallthrough - case "monthly": - fallthrough - case "pro-rata": - fallthrough - case "other": - *e = PaymentFrequency(v) - return nil - default: - return fmt.Errorf("invalid value for PaymentFrequency: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/paymentinput.go b/tests/mockserver/internal/sdk/models/components/paymentinput.go deleted file mode 100644 index 4cb02d17..00000000 --- a/tests/mockserver/internal/sdk/models/components/paymentinput.go +++ /dev/null @@ -1,250 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type PaymentInput struct { - // 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"` - // Currency Exchange Rate at the time entity was recorded/generated. - CurrencyRate *float64 `json:"currency_rate,omitempty"` - // The total amount of the transaction or record - TotalAmount *float64 `json:"total_amount"` - // Optional transaction reference message ie: Debit remittance detail. - Reference *string `json:"reference,omitempty"` - // Payment method used for the transaction, such as cash, credit card, bank transfer, or check - PaymentMethod *string `json:"payment_method,omitempty"` - // Optional reference message returned by payment method on processing - PaymentMethodReference *string `json:"payment_method_reference,omitempty"` - // A unique identifier for an object. - PaymentMethodID *string `json:"payment_method_id,omitempty"` - // Type of accounts receivable account. - // - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - AccountsReceivableAccountType *string `json:"accounts_receivable_account_type,omitempty"` - // Unique identifier for the account to allocate payment to. - // - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - AccountsReceivableAccountID *string `json:"accounts_receivable_account_id,omitempty"` - Account *LinkedLedgerAccountInput `json:"account,omitempty"` - // The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD - TransactionDate *time.Time `json:"transaction_date"` - // The customer this entity is linked to. - Customer *LinkedCustomerInput `json:"customer,omitempty"` - // The supplier this entity is linked to. - // - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - Supplier *DeprecatedLinkedSupplierInput `json:"supplier,omitempty"` - // The company or subsidiary id the transaction belongs to - CompanyID *string `json:"company_id,omitempty"` - // Indicates if the transaction has been reconciled. - Reconciled *bool `json:"reconciled,omitempty"` - // Status of payment - Status *PaymentStatus `json:"status,omitempty"` - // Type of payment - Type *PaymentType `json:"type,omitempty"` - Allocations []AllocationInput `json:"allocations,omitempty"` - // Note associated with the transaction - Note *string `json:"note,omitempty"` - // Number associated with the transaction - Number *string `json:"number,omitempty"` - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // Id to be displayed. - DisplayID *string `json:"display_id,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (p PaymentInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *PaymentInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { - return err - } - return nil -} - -func (o *PaymentInput) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *PaymentInput) GetCurrencyRate() *float64 { - if o == nil { - return nil - } - return o.CurrencyRate -} - -func (o *PaymentInput) GetTotalAmount() *float64 { - if o == nil { - return nil - } - return o.TotalAmount -} - -func (o *PaymentInput) GetReference() *string { - if o == nil { - return nil - } - return o.Reference -} - -func (o *PaymentInput) GetPaymentMethod() *string { - if o == nil { - return nil - } - return o.PaymentMethod -} - -func (o *PaymentInput) GetPaymentMethodReference() *string { - if o == nil { - return nil - } - return o.PaymentMethodReference -} - -func (o *PaymentInput) GetPaymentMethodID() *string { - if o == nil { - return nil - } - return o.PaymentMethodID -} - -func (o *PaymentInput) GetAccountsReceivableAccountType() *string { - if o == nil { - return nil - } - return o.AccountsReceivableAccountType -} - -func (o *PaymentInput) GetAccountsReceivableAccountID() *string { - if o == nil { - return nil - } - return o.AccountsReceivableAccountID -} - -func (o *PaymentInput) GetAccount() *LinkedLedgerAccountInput { - if o == nil { - return nil - } - return o.Account -} - -func (o *PaymentInput) GetTransactionDate() *time.Time { - if o == nil { - return nil - } - return o.TransactionDate -} - -func (o *PaymentInput) GetCustomer() *LinkedCustomerInput { - if o == nil { - return nil - } - return o.Customer -} - -func (o *PaymentInput) GetSupplier() *DeprecatedLinkedSupplierInput { - if o == nil { - return nil - } - return o.Supplier -} - -func (o *PaymentInput) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *PaymentInput) GetReconciled() *bool { - if o == nil { - return nil - } - return o.Reconciled -} - -func (o *PaymentInput) GetStatus() *PaymentStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *PaymentInput) GetType() *PaymentType { - if o == nil { - return nil - } - return o.Type -} - -func (o *PaymentInput) GetAllocations() []AllocationInput { - if o == nil { - return nil - } - return o.Allocations -} - -func (o *PaymentInput) GetNote() *string { - if o == nil { - return nil - } - return o.Note -} - -func (o *PaymentInput) GetNumber() *string { - if o == nil { - return nil - } - return o.Number -} - -func (o *PaymentInput) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *PaymentInput) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *PaymentInput) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *PaymentInput) GetDisplayID() *string { - if o == nil { - return nil - } - return o.DisplayID -} - -func (o *PaymentInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/paymentsfilter.go b/tests/mockserver/internal/sdk/models/components/paymentsfilter.go deleted file mode 100644 index 633dbc79..00000000 --- a/tests/mockserver/internal/sdk/models/components/paymentsfilter.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type PaymentsFilter struct { - UpdatedSince *time.Time `queryParam:"name=updated_since"` - InvoiceID *string `queryParam:"name=invoice_id"` -} - -func (p PaymentsFilter) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *PaymentsFilter) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { - return err - } - return nil -} - -func (o *PaymentsFilter) GetUpdatedSince() *time.Time { - if o == nil { - return nil - } - return o.UpdatedSince -} - -func (o *PaymentsFilter) GetInvoiceID() *string { - if o == nil { - return nil - } - return o.InvoiceID -} diff --git a/tests/mockserver/internal/sdk/models/components/paymentssort.go b/tests/mockserver/internal/sdk/models/components/paymentssort.go deleted file mode 100644 index db2a187f..00000000 --- a/tests/mockserver/internal/sdk/models/components/paymentssort.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// PaymentsSortBy - The field on which to sort the Payments -type PaymentsSortBy string - -const ( - PaymentsSortByUpdatedAt PaymentsSortBy = "updated_at" - PaymentsSortByCreatedAt PaymentsSortBy = "created_at" -) - -func (e PaymentsSortBy) ToPointer() *PaymentsSortBy { - return &e -} -func (e *PaymentsSortBy) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "updated_at": - fallthrough - case "created_at": - *e = PaymentsSortBy(v) - return nil - default: - return fmt.Errorf("invalid value for PaymentsSortBy: %v", v) - } -} - -type PaymentsSort struct { - // The field on which to sort the Payments - By *PaymentsSortBy `queryParam:"name=by"` - // The direction in which to sort the results - Direction *SortDirection `default:"asc" queryParam:"name=direction"` -} - -func (p PaymentsSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *PaymentsSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { - return err - } - return nil -} - -func (o *PaymentsSort) GetBy() *PaymentsSortBy { - if o == nil { - return nil - } - return o.By -} - -func (o *PaymentsSort) GetDirection() *SortDirection { - if o == nil { - return nil - } - return o.Direction -} diff --git a/tests/mockserver/internal/sdk/models/components/paymentstatus.go b/tests/mockserver/internal/sdk/models/components/paymentstatus.go deleted file mode 100644 index e714a2a1..00000000 --- a/tests/mockserver/internal/sdk/models/components/paymentstatus.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// PaymentStatus - Status of payment -type PaymentStatus string - -const ( - PaymentStatusDraft PaymentStatus = "draft" - PaymentStatusAuthorised PaymentStatus = "authorised" - PaymentStatusRejected PaymentStatus = "rejected" - PaymentStatusPaid PaymentStatus = "paid" - PaymentStatusVoided PaymentStatus = "voided" - PaymentStatusDeleted PaymentStatus = "deleted" -) - -func (e PaymentStatus) ToPointer() *PaymentStatus { - return &e -} -func (e *PaymentStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "draft": - fallthrough - case "authorised": - fallthrough - case "rejected": - fallthrough - case "paid": - fallthrough - case "voided": - fallthrough - case "deleted": - *e = PaymentStatus(v) - return nil - default: - return fmt.Errorf("invalid value for PaymentStatus: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/paymenttype.go b/tests/mockserver/internal/sdk/models/components/paymenttype.go deleted file mode 100644 index a9c4332f..00000000 --- a/tests/mockserver/internal/sdk/models/components/paymenttype.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// PaymentType - Type of payment -type PaymentType string - -const ( - PaymentTypeAccountsReceivable PaymentType = "accounts_receivable" - PaymentTypeAccountsPayable PaymentType = "accounts_payable" - PaymentTypeAccountsReceivableCredit PaymentType = "accounts_receivable_credit" - PaymentTypeAccountsPayableCredit PaymentType = "accounts_payable_credit" - PaymentTypeAccountsReceivableOverpayment PaymentType = "accounts_receivable_overpayment" - PaymentTypeAccountsPayableOverpayment PaymentType = "accounts_payable_overpayment" - PaymentTypeAccountsReceivablePrepayment PaymentType = "accounts_receivable_prepayment" - PaymentTypeAccountsPayablePrepayment PaymentType = "accounts_payable_prepayment" -) - -func (e PaymentType) ToPointer() *PaymentType { - return &e -} -func (e *PaymentType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "accounts_receivable": - fallthrough - case "accounts_payable": - fallthrough - case "accounts_receivable_credit": - fallthrough - case "accounts_payable_credit": - fallthrough - case "accounts_receivable_overpayment": - fallthrough - case "accounts_payable_overpayment": - fallthrough - case "accounts_receivable_prepayment": - fallthrough - case "accounts_payable_prepayment": - *e = PaymentType(v) - return nil - default: - return fmt.Errorf("invalid value for PaymentType: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/paymentunit.go b/tests/mockserver/internal/sdk/models/components/paymentunit.go deleted file mode 100644 index ef2533f7..00000000 --- a/tests/mockserver/internal/sdk/models/components/paymentunit.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// PaymentUnit - Unit of measurement for employee compensation. -type PaymentUnit string - -const ( - PaymentUnitHour PaymentUnit = "hour" - PaymentUnitWeek PaymentUnit = "week" - PaymentUnitMonth PaymentUnit = "month" - PaymentUnitYear PaymentUnit = "year" - PaymentUnitPaycheck PaymentUnit = "paycheck" - PaymentUnitOther PaymentUnit = "other" -) - -func (e PaymentUnit) ToPointer() *PaymentUnit { - return &e -} -func (e *PaymentUnit) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "hour": - fallthrough - case "week": - fallthrough - case "month": - fallthrough - case "year": - fallthrough - case "paycheck": - fallthrough - case "other": - *e = PaymentUnit(v) - return nil - default: - return fmt.Errorf("invalid value for PaymentUnit: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/payroll.go b/tests/mockserver/internal/sdk/models/components/payroll.go deleted file mode 100644 index 02591c29..00000000 --- a/tests/mockserver/internal/sdk/models/components/payroll.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type Payroll struct { - // A unique identifier for an object. - ID *string `json:"id"` - // The unique identifier of the company. - CompanyID *string `json:"company_id,omitempty"` - // Whether or not the payroll has been successfully processed. Note that processed payrolls cannot be updated. - Processed *bool `json:"processed"` - // The date the payroll was processed. - ProcessedDate *string `json:"processed_date,omitempty"` - // The date on which employees will be paid for the payroll. - CheckDate *string `json:"check_date"` - // The start date, inclusive, of the pay period. - StartDate *string `json:"start_date"` - // The end date, inclusive, of the pay period. - EndDate *string `json:"end_date"` - // The overview of the payroll totals. - Totals *PayrollTotals `json:"totals,omitempty"` - // An array of compensations for the payroll. - Compensations []Compensation `json:"compensations,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` -} - -func (o *Payroll) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Payroll) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *Payroll) GetProcessed() *bool { - if o == nil { - return nil - } - return o.Processed -} - -func (o *Payroll) GetProcessedDate() *string { - if o == nil { - return nil - } - return o.ProcessedDate -} - -func (o *Payroll) GetCheckDate() *string { - if o == nil { - return nil - } - return o.CheckDate -} - -func (o *Payroll) GetStartDate() *string { - if o == nil { - return nil - } - return o.StartDate -} - -func (o *Payroll) GetEndDate() *string { - if o == nil { - return nil - } - return o.EndDate -} - -func (o *Payroll) GetTotals() *PayrollTotals { - if o == nil { - return nil - } - return o.Totals -} - -func (o *Payroll) GetCompensations() []Compensation { - if o == nil { - return nil - } - return o.Compensations -} - -func (o *Payroll) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} diff --git a/tests/mockserver/internal/sdk/models/components/payrollsfilter.go b/tests/mockserver/internal/sdk/models/components/payrollsfilter.go deleted file mode 100644 index f2914df0..00000000 --- a/tests/mockserver/internal/sdk/models/components/payrollsfilter.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type PayrollsFilter struct { - // Return payrolls whose pay period is after the start date - StartDate *string `queryParam:"name=start_date"` - // Return payrolls whose pay period is before the end date - EndDate *string `queryParam:"name=end_date"` -} - -func (o *PayrollsFilter) GetStartDate() *string { - if o == nil { - return nil - } - return o.StartDate -} - -func (o *PayrollsFilter) GetEndDate() *string { - if o == nil { - return nil - } - return o.EndDate -} diff --git a/tests/mockserver/internal/sdk/models/components/payrolltotals.go b/tests/mockserver/internal/sdk/models/components/payrolltotals.go deleted file mode 100644 index e122bcd3..00000000 --- a/tests/mockserver/internal/sdk/models/components/payrolltotals.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// PayrollTotals - The overview of the payroll totals. -type PayrollTotals struct { - // The total company debit for the payroll. - CompanyDebit *float64 `json:"company_debit,omitempty"` - // The total tax debit for the payroll. - TaxDebit *float64 `json:"tax_debit,omitempty"` - // The total check amount for the payroll. - CheckAmount *float64 `json:"check_amount,omitempty"` - // The net pay amount for the payroll. - NetPay *float64 `json:"net_pay,omitempty"` - // The gross pay amount for the payroll. - GrossPay *float64 `json:"gross_pay,omitempty"` - // The total amount of employer paid taxes for the payroll. - EmployerTaxes *float64 `json:"employer_taxes,omitempty"` - // The total amount of employee paid taxes for the payroll. - EmployeeTaxes *float64 `json:"employee_taxes,omitempty"` - // The total amount of company contributed benefits for the payroll. - EmployerBenefitContributions *float64 `json:"employer_benefit_contributions,omitempty"` - // The total amount of employee deducted benefits for the payroll. - EmployeeBenefitDeductions *float64 `json:"employee_benefit_deductions,omitempty"` -} - -func (o *PayrollTotals) GetCompanyDebit() *float64 { - if o == nil { - return nil - } - return o.CompanyDebit -} - -func (o *PayrollTotals) GetTaxDebit() *float64 { - if o == nil { - return nil - } - return o.TaxDebit -} - -func (o *PayrollTotals) GetCheckAmount() *float64 { - if o == nil { - return nil - } - return o.CheckAmount -} - -func (o *PayrollTotals) GetNetPay() *float64 { - if o == nil { - return nil - } - return o.NetPay -} - -func (o *PayrollTotals) GetGrossPay() *float64 { - if o == nil { - return nil - } - return o.GrossPay -} - -func (o *PayrollTotals) GetEmployerTaxes() *float64 { - if o == nil { - return nil - } - return o.EmployerTaxes -} - -func (o *PayrollTotals) GetEmployeeTaxes() *float64 { - if o == nil { - return nil - } - return o.EmployeeTaxes -} - -func (o *PayrollTotals) GetEmployerBenefitContributions() *float64 { - if o == nil { - return nil - } - return o.EmployerBenefitContributions -} - -func (o *PayrollTotals) GetEmployeeBenefitDeductions() *float64 { - if o == nil { - return nil - } - return o.EmployeeBenefitDeductions -} diff --git a/tests/mockserver/internal/sdk/models/components/person.go b/tests/mockserver/internal/sdk/models/components/person.go deleted file mode 100644 index dd84e2c7..00000000 --- a/tests/mockserver/internal/sdk/models/components/person.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/types" - "mockserver/internal/sdk/utils" -) - -type Person struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The first name of the person. - FirstName *string `json:"first_name,omitempty"` - // The last name of the person. - LastName *string `json:"last_name,omitempty"` - // Middle name of the person. - MiddleName *string `json:"middle_name,omitempty"` - // The gender represents the gender identity of a person. - Gender *Gender `json:"gender,omitempty"` - // Initials of the person - Initials *string `json:"initials,omitempty"` - // Date of birth - Birthday *types.Date `json:"birthday,omitempty"` - // Date of death - DeceasedOn *types.Date `json:"deceased_on,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` -} - -func (p Person) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *Person) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Person) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Person) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *Person) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *Person) GetMiddleName() *string { - if o == nil { - return nil - } - return o.MiddleName -} - -func (o *Person) GetGender() *Gender { - if o == nil { - return nil - } - return o.Gender -} - -func (o *Person) GetInitials() *string { - if o == nil { - return nil - } - return o.Initials -} - -func (o *Person) GetBirthday() *types.Date { - if o == nil { - return nil - } - return o.Birthday -} - -func (o *Person) GetDeceasedOn() *types.Date { - if o == nil { - return nil - } - return o.DeceasedOn -} - -func (o *Person) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} diff --git a/tests/mockserver/internal/sdk/models/components/personinput.go b/tests/mockserver/internal/sdk/models/components/personinput.go deleted file mode 100644 index e2066536..00000000 --- a/tests/mockserver/internal/sdk/models/components/personinput.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/types" - "mockserver/internal/sdk/utils" -) - -type PersonInput struct { - // The first name of the person. - FirstName *string `json:"first_name,omitempty"` - // The last name of the person. - LastName *string `json:"last_name,omitempty"` - // Middle name of the person. - MiddleName *string `json:"middle_name,omitempty"` - // The gender represents the gender identity of a person. - Gender *Gender `json:"gender,omitempty"` - // Initials of the person - Initials *string `json:"initials,omitempty"` - // Date of birth - Birthday *types.Date `json:"birthday,omitempty"` - // Date of death - DeceasedOn *types.Date `json:"deceased_on,omitempty"` -} - -func (p PersonInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *PersonInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { - return err - } - return nil -} - -func (o *PersonInput) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *PersonInput) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *PersonInput) GetMiddleName() *string { - if o == nil { - return nil - } - return o.MiddleName -} - -func (o *PersonInput) GetGender() *Gender { - if o == nil { - return nil - } - return o.Gender -} - -func (o *PersonInput) GetInitials() *string { - if o == nil { - return nil - } - return o.Initials -} - -func (o *PersonInput) GetBirthday() *types.Date { - if o == nil { - return nil - } - return o.Birthday -} - -func (o *PersonInput) GetDeceasedOn() *types.Date { - if o == nil { - return nil - } - return o.DeceasedOn -} diff --git a/tests/mockserver/internal/sdk/models/components/phonenumber.go b/tests/mockserver/internal/sdk/models/components/phonenumber.go deleted file mode 100644 index 1bcd43ca..00000000 --- a/tests/mockserver/internal/sdk/models/components/phonenumber.go +++ /dev/null @@ -1,119 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// PhoneNumberType - The type of phone number -type PhoneNumberType string - -const ( - PhoneNumberTypePrimary PhoneNumberType = "primary" - PhoneNumberTypeSecondary PhoneNumberType = "secondary" - PhoneNumberTypeHome PhoneNumberType = "home" - PhoneNumberTypeWork PhoneNumberType = "work" - PhoneNumberTypeOffice PhoneNumberType = "office" - PhoneNumberTypeMobile PhoneNumberType = "mobile" - PhoneNumberTypeAssistant PhoneNumberType = "assistant" - PhoneNumberTypeFax PhoneNumberType = "fax" - PhoneNumberTypeDirectDialIn PhoneNumberType = "direct-dial-in" - PhoneNumberTypePersonal PhoneNumberType = "personal" - PhoneNumberTypeOther PhoneNumberType = "other" -) - -func (e PhoneNumberType) ToPointer() *PhoneNumberType { - return &e -} -func (e *PhoneNumberType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "primary": - fallthrough - case "secondary": - fallthrough - case "home": - fallthrough - case "work": - fallthrough - case "office": - fallthrough - case "mobile": - fallthrough - case "assistant": - fallthrough - case "fax": - fallthrough - case "direct-dial-in": - fallthrough - case "personal": - fallthrough - case "other": - *e = PhoneNumberType(v) - return nil - default: - return fmt.Errorf("invalid value for PhoneNumberType: %v", v) - } -} - -type PhoneNumber struct { - // Unique identifier of the phone number - ID *string `json:"id,omitempty"` - // The country code of the phone number, e.g. +1 - CountryCode *string `json:"country_code,omitempty"` - // The area code of the phone number, e.g. 323 - AreaCode *string `json:"area_code,omitempty"` - // The phone number - Number string `json:"number"` - // The extension of the phone number - Extension *string `json:"extension,omitempty"` - // The type of phone number - Type *PhoneNumberType `json:"type,omitempty"` -} - -func (o *PhoneNumber) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *PhoneNumber) GetCountryCode() *string { - if o == nil { - return nil - } - return o.CountryCode -} - -func (o *PhoneNumber) GetAreaCode() *string { - if o == nil { - return nil - } - return o.AreaCode -} - -func (o *PhoneNumber) GetNumber() string { - if o == nil { - return "" - } - return o.Number -} - -func (o *PhoneNumber) GetExtension() *string { - if o == nil { - return nil - } - return o.Extension -} - -func (o *PhoneNumber) GetType() *PhoneNumberType { - if o == nil { - return nil - } - return o.Type -} diff --git a/tests/mockserver/internal/sdk/models/components/pipeline.go b/tests/mockserver/internal/sdk/models/components/pipeline.go deleted file mode 100644 index a7ac40be..00000000 --- a/tests/mockserver/internal/sdk/models/components/pipeline.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type PipelineStage struct { - // The unique identifier of the Pipeline Stage. - ID *string `json:"id,omitempty"` - // The name of the Pipeline Stage. - Name *string `json:"name,omitempty"` - // The value of the Pipeline Stage. - Value *string `json:"value,omitempty"` - // The expected probability of winning an Opportunity in this Pipeline Stage. Valid values are [0-100]. - WinProbability *int64 `json:"win_probability,omitempty"` - // The order in which the Pipeline Stage is displayed in the UI. - DisplayOrder *int64 `json:"display_order,omitempty"` -} - -func (o *PipelineStage) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *PipelineStage) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *PipelineStage) GetValue() *string { - if o == nil { - return nil - } - return o.Value -} - -func (o *PipelineStage) GetWinProbability() *int64 { - if o == nil { - return nil - } - return o.WinProbability -} - -func (o *PipelineStage) GetDisplayOrder() *int64 { - if o == nil { - return nil - } - return o.DisplayOrder -} - -type Pipeline struct { - // The unique identifier of the Pipeline. - ID *string `json:"id,omitempty"` - // The name of the Pipeline. - Name string `json:"name"` - // 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"` - // Whether the Pipeline is archived or not. - Archived *bool `json:"archived,omitempty"` - // Whether the Pipeline is active or not. - Active *bool `json:"active,omitempty"` - // The order in which the Pipeline is displayed in the UI. - DisplayOrder *int64 `json:"display_order,omitempty"` - // Whether the Pipeline has win probability enabled or not. - WinProbabilityEnabled *bool `json:"win_probability_enabled,omitempty"` - // The Pipeline Stages. - Stages []PipelineStage `json:"stages,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (p Pipeline) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *Pipeline) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Pipeline) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Pipeline) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *Pipeline) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *Pipeline) GetArchived() *bool { - if o == nil { - return nil - } - return o.Archived -} - -func (o *Pipeline) GetActive() *bool { - if o == nil { - return nil - } - return o.Active -} - -func (o *Pipeline) GetDisplayOrder() *int64 { - if o == nil { - return nil - } - return o.DisplayOrder -} - -func (o *Pipeline) GetWinProbabilityEnabled() *bool { - if o == nil { - return nil - } - return o.WinProbabilityEnabled -} - -func (o *Pipeline) GetStages() []PipelineStage { - if o == nil { - return nil - } - return o.Stages -} - -func (o *Pipeline) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Pipeline) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Pipeline) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/pipelineinput.go b/tests/mockserver/internal/sdk/models/components/pipelineinput.go deleted file mode 100644 index f638320b..00000000 --- a/tests/mockserver/internal/sdk/models/components/pipelineinput.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type StageInput struct { - // The name of the Pipeline Stage. - Name *string `json:"name,omitempty"` - // The value of the Pipeline Stage. - Value *string `json:"value,omitempty"` - // The expected probability of winning an Opportunity in this Pipeline Stage. Valid values are [0-100]. - WinProbability *int64 `json:"win_probability,omitempty"` - // The order in which the Pipeline Stage is displayed in the UI. - DisplayOrder *int64 `json:"display_order,omitempty"` -} - -func (o *StageInput) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *StageInput) GetValue() *string { - if o == nil { - return nil - } - return o.Value -} - -func (o *StageInput) GetWinProbability() *int64 { - if o == nil { - return nil - } - return o.WinProbability -} - -func (o *StageInput) GetDisplayOrder() *int64 { - if o == nil { - return nil - } - return o.DisplayOrder -} - -type PipelineInput struct { - // The unique identifier of the Pipeline. - ID *string `json:"id,omitempty"` - // The name of the Pipeline. - Name string `json:"name"` - // 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"` - // Whether the Pipeline is archived or not. - Archived *bool `json:"archived,omitempty"` - // Whether the Pipeline is active or not. - Active *bool `json:"active,omitempty"` - // The order in which the Pipeline is displayed in the UI. - DisplayOrder *int64 `json:"display_order,omitempty"` - // Whether the Pipeline has win probability enabled or not. - WinProbabilityEnabled *bool `json:"win_probability_enabled,omitempty"` - // The Pipeline Stages. - Stages []StageInput `json:"stages,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *PipelineInput) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *PipelineInput) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *PipelineInput) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *PipelineInput) GetArchived() *bool { - if o == nil { - return nil - } - return o.Archived -} - -func (o *PipelineInput) GetActive() *bool { - if o == nil { - return nil - } - return o.Active -} - -func (o *PipelineInput) GetDisplayOrder() *int64 { - if o == nil { - return nil - } - return o.DisplayOrder -} - -func (o *PipelineInput) GetWinProbabilityEnabled() *bool { - if o == nil { - return nil - } - return o.WinProbabilityEnabled -} - -func (o *PipelineInput) GetStages() []StageInput { - if o == nil { - return nil - } - return o.Stages -} - -func (o *PipelineInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/profitandloss.go b/tests/mockserver/internal/sdk/models/components/profitandloss.go deleted file mode 100644 index 8d9aee5b..00000000 --- a/tests/mockserver/internal/sdk/models/components/profitandloss.go +++ /dev/null @@ -1,489 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// Income - The operating income accounts -type Income struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The account code of the account - Code *string `json:"code,omitempty"` - // The name of the account. - Title *string `json:"title,omitempty"` - // The type of profit and loss - Type *ProfitAndLossType `json:"type,omitempty"` - // The aggregated total of all accounts within this category. - Total *float64 `json:"total"` - Records any `json:"records"` -} - -func (o *Income) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Income) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *Income) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *Income) GetType() *ProfitAndLossType { - if o == nil { - return nil - } - return o.Type -} - -func (o *Income) GetTotal() *float64 { - if o == nil { - return nil - } - return o.Total -} - -func (o *Income) GetRecords() any { - if o == nil { - return nil - } - return o.Records -} - -// CostOfGoodsSold - The cost of goods sold accounts -type CostOfGoodsSold struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The account code of the account - Code *string `json:"code,omitempty"` - // The name of the account. - Title *string `json:"title,omitempty"` - // The type of profit and loss - Type *ProfitAndLossType `json:"type,omitempty"` - // The aggregated total of all accounts within this category. - Total *float64 `json:"total,omitempty"` - Records any `json:"records"` -} - -func (o *CostOfGoodsSold) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *CostOfGoodsSold) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *CostOfGoodsSold) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *CostOfGoodsSold) GetType() *ProfitAndLossType { - if o == nil { - return nil - } - return o.Type -} - -func (o *CostOfGoodsSold) GetTotal() *float64 { - if o == nil { - return nil - } - return o.Total -} - -func (o *CostOfGoodsSold) GetRecords() any { - if o == nil { - return nil - } - return o.Records -} - -// Expenses - The operating expenses accounts -type Expenses struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The account code of the account - Code *string `json:"code,omitempty"` - // The name of the account. - Title *string `json:"title,omitempty"` - // The type of profit and loss - Type *ProfitAndLossType `json:"type,omitempty"` - // The aggregated total of all accounts within this category. - Total *float64 `json:"total"` - Records any `json:"records"` -} - -func (o *Expenses) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Expenses) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *Expenses) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *Expenses) GetType() *ProfitAndLossType { - if o == nil { - return nil - } - return o.Type -} - -func (o *Expenses) GetTotal() *float64 { - if o == nil { - return nil - } - return o.Total -} - -func (o *Expenses) GetRecords() any { - if o == nil { - return nil - } - return o.Records -} - -// OtherIncome - The other income accounts -type OtherIncome struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The account code of the account - Code *string `json:"code,omitempty"` - // The name of the account. - Title *string `json:"title,omitempty"` - // The type of profit and loss - Type *ProfitAndLossType `json:"type,omitempty"` - // The aggregated total of all accounts within this category. - Total *float64 `json:"total,omitempty"` - Records any `json:"records"` -} - -func (o *OtherIncome) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *OtherIncome) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *OtherIncome) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *OtherIncome) GetType() *ProfitAndLossType { - if o == nil { - return nil - } - return o.Type -} - -func (o *OtherIncome) GetTotal() *float64 { - if o == nil { - return nil - } - return o.Total -} - -func (o *OtherIncome) GetRecords() any { - if o == nil { - return nil - } - return o.Records -} - -// OtherExpenses - The other expenses accounts -type OtherExpenses struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The account code of the account - Code *string `json:"code,omitempty"` - // The name of the account. - Title *string `json:"title,omitempty"` - // The type of profit and loss - Type *ProfitAndLossType `json:"type,omitempty"` - // The aggregated total of all accounts within this category. - Total *float64 `json:"total,omitempty"` - Records any `json:"records"` -} - -func (o *OtherExpenses) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *OtherExpenses) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *OtherExpenses) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *OtherExpenses) GetType() *ProfitAndLossType { - if o == nil { - return nil - } - return o.Type -} - -func (o *OtherExpenses) GetTotal() *float64 { - if o == nil { - return nil - } - return o.Total -} - -func (o *OtherExpenses) GetRecords() any { - if o == nil { - return nil - } - return o.Records -} - -// UncategorizedAccounts - The accounts not categorized in the other sections -type UncategorizedAccounts struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The account code of the account - Code *string `json:"code,omitempty"` - // The name of the account. - Title *string `json:"title,omitempty"` - // The type of profit and loss - Type *ProfitAndLossType `json:"type,omitempty"` - // The aggregated total of all accounts within this category. - Total *float64 `json:"total"` - Records any `json:"records"` -} - -func (o *UncategorizedAccounts) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *UncategorizedAccounts) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *UncategorizedAccounts) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *UncategorizedAccounts) GetType() *ProfitAndLossType { - if o == nil { - return nil - } - return o.Type -} - -func (o *UncategorizedAccounts) GetTotal() *float64 { - if o == nil { - return nil - } - return o.Total -} - -func (o *UncategorizedAccounts) GetRecords() any { - if o == nil { - return nil - } - return o.Records -} - -type ProfitAndLoss struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The name of the report - ReportName string `json:"report_name"` - // The start date of the report - StartDate *string `json:"start_date,omitempty"` - // The end date of the report - EndDate *string `json:"end_date,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 operating income accounts - Income Income `json:"income"` - // The cost of goods sold accounts - CostOfGoodsSold *CostOfGoodsSold `json:"cost_of_goods_sold,omitempty"` - // The operating expenses accounts - Expenses Expenses `json:"expenses"` - // The other income accounts - OtherIncome *OtherIncome `json:"other_income,omitempty"` - // The other expenses accounts - OtherExpenses *OtherExpenses `json:"other_expenses,omitempty"` - // The accounts not categorized in the other sections - UncategorizedAccounts *UncategorizedAccounts `json:"uncategorized_accounts,omitempty"` - GrossProfit *ProfitAndLossIndicator `json:"gross_profit,omitempty"` - NetOperatingIncome *ProfitAndLossIndicator `json:"net_operating_income,omitempty"` - NetIncome *ProfitAndLossIndicator `json:"net_income,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // The customer id - Customer *string `json:"customer,omitempty"` -} - -func (o *ProfitAndLoss) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *ProfitAndLoss) GetReportName() string { - if o == nil { - return "" - } - return o.ReportName -} - -func (o *ProfitAndLoss) GetStartDate() *string { - if o == nil { - return nil - } - return o.StartDate -} - -func (o *ProfitAndLoss) GetEndDate() *string { - if o == nil { - return nil - } - return o.EndDate -} - -func (o *ProfitAndLoss) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *ProfitAndLoss) GetIncome() Income { - if o == nil { - return Income{} - } - return o.Income -} - -func (o *ProfitAndLoss) GetCostOfGoodsSold() *CostOfGoodsSold { - if o == nil { - return nil - } - return o.CostOfGoodsSold -} - -func (o *ProfitAndLoss) GetExpenses() Expenses { - if o == nil { - return Expenses{} - } - return o.Expenses -} - -func (o *ProfitAndLoss) GetOtherIncome() *OtherIncome { - if o == nil { - return nil - } - return o.OtherIncome -} - -func (o *ProfitAndLoss) GetOtherExpenses() *OtherExpenses { - if o == nil { - return nil - } - return o.OtherExpenses -} - -func (o *ProfitAndLoss) GetUncategorizedAccounts() *UncategorizedAccounts { - if o == nil { - return nil - } - return o.UncategorizedAccounts -} - -func (o *ProfitAndLoss) GetGrossProfit() *ProfitAndLossIndicator { - if o == nil { - return nil - } - return o.GrossProfit -} - -func (o *ProfitAndLoss) GetNetOperatingIncome() *ProfitAndLossIndicator { - if o == nil { - return nil - } - return o.NetOperatingIncome -} - -func (o *ProfitAndLoss) GetNetIncome() *ProfitAndLossIndicator { - if o == nil { - return nil - } - return o.NetIncome -} - -func (o *ProfitAndLoss) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *ProfitAndLoss) GetCustomer() *string { - if o == nil { - return nil - } - return o.Customer -} diff --git a/tests/mockserver/internal/sdk/models/components/profitandlossfilter.go b/tests/mockserver/internal/sdk/models/components/profitandlossfilter.go deleted file mode 100644 index 682c4140..00000000 --- a/tests/mockserver/internal/sdk/models/components/profitandlossfilter.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type ProfitAndLossFilter struct { - // Filter by customer id - CustomerID *string `queryParam:"name=customer_id"` - // Filter by start date. If start date is given, end date is required. - StartDate *string `queryParam:"name=start_date"` - // Filter by end date. If end date is given, start date is required. - EndDate *string `queryParam:"name=end_date"` -} - -func (o *ProfitAndLossFilter) GetCustomerID() *string { - if o == nil { - return nil - } - return o.CustomerID -} - -func (o *ProfitAndLossFilter) GetStartDate() *string { - if o == nil { - return nil - } - return o.StartDate -} - -func (o *ProfitAndLossFilter) GetEndDate() *string { - if o == nil { - return nil - } - return o.EndDate -} diff --git a/tests/mockserver/internal/sdk/models/components/profitandlossindicator.go b/tests/mockserver/internal/sdk/models/components/profitandlossindicator.go deleted file mode 100644 index 34abbf3b..00000000 --- a/tests/mockserver/internal/sdk/models/components/profitandlossindicator.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type ProfitAndLossIndicator struct { - // The total amount of the transaction or record - Total *float64 `json:"total,omitempty"` -} - -func (o *ProfitAndLossIndicator) GetTotal() *float64 { - if o == nil { - return nil - } - return o.Total -} diff --git a/tests/mockserver/internal/sdk/models/components/profitandlosstype.go b/tests/mockserver/internal/sdk/models/components/profitandlosstype.go deleted file mode 100644 index f379c72f..00000000 --- a/tests/mockserver/internal/sdk/models/components/profitandlosstype.go +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// ProfitAndLossType - The type of profit and loss -type ProfitAndLossType string - -const ( - ProfitAndLossTypeSection ProfitAndLossType = "Section" - ProfitAndLossTypeRecord ProfitAndLossType = "Record" -) - -func (e ProfitAndLossType) ToPointer() *ProfitAndLossType { - return &e -} -func (e *ProfitAndLossType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "Section": - fallthrough - case "Record": - *e = ProfitAndLossType(v) - return nil - default: - return fmt.Errorf("invalid value for ProfitAndLossType: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/purchaseorder.go b/tests/mockserver/internal/sdk/models/components/purchaseorder.go deleted file mode 100644 index bec54764..00000000 --- a/tests/mockserver/internal/sdk/models/components/purchaseorder.go +++ /dev/null @@ -1,686 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/types" - "mockserver/internal/sdk/utils" - "time" -) - -type PurchaseOrderStatus string - -const ( - PurchaseOrderStatusDraft PurchaseOrderStatus = "draft" - PurchaseOrderStatusOpen PurchaseOrderStatus = "open" - PurchaseOrderStatusClosed PurchaseOrderStatus = "closed" - PurchaseOrderStatusDeleted PurchaseOrderStatus = "deleted" - PurchaseOrderStatusBilled PurchaseOrderStatus = "billed" - PurchaseOrderStatusOther PurchaseOrderStatus = "other" -) - -func (e PurchaseOrderStatus) ToPointer() *PurchaseOrderStatus { - return &e -} -func (e *PurchaseOrderStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "draft": - fallthrough - case "open": - fallthrough - case "closed": - fallthrough - case "deleted": - fallthrough - case "billed": - fallthrough - case "other": - *e = PurchaseOrderStatus(v) - return nil - default: - return fmt.Errorf("invalid value for PurchaseOrderStatus: %v", v) - } -} - -type PurchaseOrder struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The third-party API ID of original entity - DownstreamID *string `json:"downstream_id,omitempty"` - // A PO Number uniquely identifies a purchase order and is generally defined by the buyer. - PoNumber *string `json:"po_number,omitempty"` - // Optional purchase order reference. - Reference *string `json:"reference,omitempty"` - // The supplier this entity is linked to. - Supplier *LinkedSupplier `json:"supplier,omitempty"` - // The ID of the subsidiary - SubsidiaryID *string `json:"subsidiary_id,omitempty"` - // The company or subsidiary id the transaction belongs to - CompanyID *string `json:"company_id,omitempty"` - Status *PurchaseOrderStatus `json:"status,omitempty"` - // Date purchase order was issued - YYYY-MM-DD. - IssuedDate *types.Date `json:"issued_date,omitempty"` - // The date on which the purchase order is to be delivered - YYYY-MM-DD. - DeliveryDate *types.Date `json:"delivery_date,omitempty"` - // The date on which the order is expected to arrive - YYYY-MM-DD. - ExpectedArrivalDate *types.Date `json:"expected_arrival_date,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"` - // Currency Exchange Rate at the time entity was recorded/generated. - CurrencyRate *float64 `json:"currency_rate,omitempty"` - // Sub-total amount, normally before tax. - SubTotal *float64 `json:"sub_total,omitempty"` - // Total tax amount applied to this invoice. - TotalTax *float64 `json:"total_tax,omitempty"` - // Total amount of invoice, including tax. - Total *float64 `json:"total,omitempty"` - // Amounts are including tax - TaxInclusive *bool `json:"tax_inclusive,omitempty"` - LineItems []InvoiceLineItem `json:"line_items,omitempty"` - ShippingAddress *Address `json:"shipping_address,omitempty"` - LedgerAccount *LinkedLedgerAccount `json:"ledger_account,omitempty"` - // Optional purchase order template - TemplateID *string `json:"template_id,omitempty"` - // Discount percentage applied to this transaction. - DiscountPercentage *float64 `json:"discount_percentage,omitempty"` - BankAccount *BankAccount `json:"bank_account,omitempty"` - // Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. - AccountingByRow *bool `json:"accounting_by_row,omitempty"` - // The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. - DueDate *types.Date `json:"due_date,omitempty"` - // Payment method used for the transaction, such as cash, credit card, bank transfer, or check - PaymentMethod *string `json:"payment_method,omitempty"` - // Applicable tax id/code override if tax is not supplied on a line item basis. - TaxCode *string `json:"tax_code,omitempty"` - // The channel through which the transaction is processed. - Channel *string `json:"channel,omitempty"` - // Message for the supplier. This text appears on the Purchase Order. - Memo *string `json:"memo,omitempty"` - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (p PurchaseOrder) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *PurchaseOrder) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { - return err - } - return nil -} - -func (o *PurchaseOrder) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *PurchaseOrder) GetDownstreamID() *string { - if o == nil { - return nil - } - return o.DownstreamID -} - -func (o *PurchaseOrder) GetPoNumber() *string { - if o == nil { - return nil - } - return o.PoNumber -} - -func (o *PurchaseOrder) GetReference() *string { - if o == nil { - return nil - } - return o.Reference -} - -func (o *PurchaseOrder) GetSupplier() *LinkedSupplier { - if o == nil { - return nil - } - return o.Supplier -} - -func (o *PurchaseOrder) GetSubsidiaryID() *string { - if o == nil { - return nil - } - return o.SubsidiaryID -} - -func (o *PurchaseOrder) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *PurchaseOrder) GetStatus() *PurchaseOrderStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *PurchaseOrder) GetIssuedDate() *types.Date { - if o == nil { - return nil - } - return o.IssuedDate -} - -func (o *PurchaseOrder) GetDeliveryDate() *types.Date { - if o == nil { - return nil - } - return o.DeliveryDate -} - -func (o *PurchaseOrder) GetExpectedArrivalDate() *types.Date { - if o == nil { - return nil - } - return o.ExpectedArrivalDate -} - -func (o *PurchaseOrder) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *PurchaseOrder) GetCurrencyRate() *float64 { - if o == nil { - return nil - } - return o.CurrencyRate -} - -func (o *PurchaseOrder) GetSubTotal() *float64 { - if o == nil { - return nil - } - return o.SubTotal -} - -func (o *PurchaseOrder) GetTotalTax() *float64 { - if o == nil { - return nil - } - return o.TotalTax -} - -func (o *PurchaseOrder) GetTotal() *float64 { - if o == nil { - return nil - } - return o.Total -} - -func (o *PurchaseOrder) GetTaxInclusive() *bool { - if o == nil { - return nil - } - return o.TaxInclusive -} - -func (o *PurchaseOrder) GetLineItems() []InvoiceLineItem { - if o == nil { - return nil - } - return o.LineItems -} - -func (o *PurchaseOrder) GetShippingAddress() *Address { - if o == nil { - return nil - } - return o.ShippingAddress -} - -func (o *PurchaseOrder) GetLedgerAccount() *LinkedLedgerAccount { - if o == nil { - return nil - } - return o.LedgerAccount -} - -func (o *PurchaseOrder) GetTemplateID() *string { - if o == nil { - return nil - } - return o.TemplateID -} - -func (o *PurchaseOrder) GetDiscountPercentage() *float64 { - if o == nil { - return nil - } - return o.DiscountPercentage -} - -func (o *PurchaseOrder) GetBankAccount() *BankAccount { - if o == nil { - return nil - } - return o.BankAccount -} - -func (o *PurchaseOrder) GetAccountingByRow() *bool { - if o == nil { - return nil - } - return o.AccountingByRow -} - -func (o *PurchaseOrder) GetDueDate() *types.Date { - if o == nil { - return nil - } - return o.DueDate -} - -func (o *PurchaseOrder) GetPaymentMethod() *string { - if o == nil { - return nil - } - return o.PaymentMethod -} - -func (o *PurchaseOrder) GetTaxCode() *string { - if o == nil { - return nil - } - return o.TaxCode -} - -func (o *PurchaseOrder) GetChannel() *string { - if o == nil { - return nil - } - return o.Channel -} - -func (o *PurchaseOrder) GetMemo() *string { - if o == nil { - return nil - } - return o.Memo -} - -func (o *PurchaseOrder) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *PurchaseOrder) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *PurchaseOrder) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *PurchaseOrder) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *PurchaseOrder) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *PurchaseOrder) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *PurchaseOrder) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *PurchaseOrder) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *PurchaseOrder) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type PurchaseOrderInput struct { - // A PO Number uniquely identifies a purchase order and is generally defined by the buyer. - PoNumber *string `json:"po_number,omitempty"` - // Optional purchase order reference. - Reference *string `json:"reference,omitempty"` - // The supplier this entity is linked to. - Supplier *LinkedSupplierInput `json:"supplier,omitempty"` - // The ID of the subsidiary - SubsidiaryID *string `json:"subsidiary_id,omitempty"` - // The company or subsidiary id the transaction belongs to - CompanyID *string `json:"company_id,omitempty"` - Status *PurchaseOrderStatus `json:"status,omitempty"` - // Date purchase order was issued - YYYY-MM-DD. - IssuedDate *types.Date `json:"issued_date,omitempty"` - // The date on which the purchase order is to be delivered - YYYY-MM-DD. - DeliveryDate *types.Date `json:"delivery_date,omitempty"` - // The date on which the order is expected to arrive - YYYY-MM-DD. - ExpectedArrivalDate *types.Date `json:"expected_arrival_date,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"` - // Currency Exchange Rate at the time entity was recorded/generated. - CurrencyRate *float64 `json:"currency_rate,omitempty"` - // Sub-total amount, normally before tax. - SubTotal *float64 `json:"sub_total,omitempty"` - // Total tax amount applied to this invoice. - TotalTax *float64 `json:"total_tax,omitempty"` - // Total amount of invoice, including tax. - Total *float64 `json:"total,omitempty"` - // Amounts are including tax - TaxInclusive *bool `json:"tax_inclusive,omitempty"` - LineItems []InvoiceLineItemInput `json:"line_items,omitempty"` - ShippingAddress *Address `json:"shipping_address,omitempty"` - LedgerAccount *LinkedLedgerAccountInput `json:"ledger_account,omitempty"` - // Optional purchase order template - TemplateID *string `json:"template_id,omitempty"` - // Discount percentage applied to this transaction. - DiscountPercentage *float64 `json:"discount_percentage,omitempty"` - BankAccount *BankAccount `json:"bank_account,omitempty"` - // Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. - AccountingByRow *bool `json:"accounting_by_row,omitempty"` - // The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. - DueDate *types.Date `json:"due_date,omitempty"` - // Payment method used for the transaction, such as cash, credit card, bank transfer, or check - PaymentMethod *string `json:"payment_method,omitempty"` - // Applicable tax id/code override if tax is not supplied on a line item basis. - TaxCode *string `json:"tax_code,omitempty"` - // The channel through which the transaction is processed. - Channel *string `json:"channel,omitempty"` - // Message for the supplier. This text appears on the Purchase Order. - Memo *string `json:"memo,omitempty"` - // A list of linked tracking categories. - TrackingCategories []*LinkedTrackingCategory `json:"tracking_categories,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (p PurchaseOrderInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *PurchaseOrderInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { - return err - } - return nil -} - -func (o *PurchaseOrderInput) GetPoNumber() *string { - if o == nil { - return nil - } - return o.PoNumber -} - -func (o *PurchaseOrderInput) GetReference() *string { - if o == nil { - return nil - } - return o.Reference -} - -func (o *PurchaseOrderInput) GetSupplier() *LinkedSupplierInput { - if o == nil { - return nil - } - return o.Supplier -} - -func (o *PurchaseOrderInput) GetSubsidiaryID() *string { - if o == nil { - return nil - } - return o.SubsidiaryID -} - -func (o *PurchaseOrderInput) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *PurchaseOrderInput) GetStatus() *PurchaseOrderStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *PurchaseOrderInput) GetIssuedDate() *types.Date { - if o == nil { - return nil - } - return o.IssuedDate -} - -func (o *PurchaseOrderInput) GetDeliveryDate() *types.Date { - if o == nil { - return nil - } - return o.DeliveryDate -} - -func (o *PurchaseOrderInput) GetExpectedArrivalDate() *types.Date { - if o == nil { - return nil - } - return o.ExpectedArrivalDate -} - -func (o *PurchaseOrderInput) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *PurchaseOrderInput) GetCurrencyRate() *float64 { - if o == nil { - return nil - } - return o.CurrencyRate -} - -func (o *PurchaseOrderInput) GetSubTotal() *float64 { - if o == nil { - return nil - } - return o.SubTotal -} - -func (o *PurchaseOrderInput) GetTotalTax() *float64 { - if o == nil { - return nil - } - return o.TotalTax -} - -func (o *PurchaseOrderInput) GetTotal() *float64 { - if o == nil { - return nil - } - return o.Total -} - -func (o *PurchaseOrderInput) GetTaxInclusive() *bool { - if o == nil { - return nil - } - return o.TaxInclusive -} - -func (o *PurchaseOrderInput) GetLineItems() []InvoiceLineItemInput { - if o == nil { - return nil - } - return o.LineItems -} - -func (o *PurchaseOrderInput) GetShippingAddress() *Address { - if o == nil { - return nil - } - return o.ShippingAddress -} - -func (o *PurchaseOrderInput) GetLedgerAccount() *LinkedLedgerAccountInput { - if o == nil { - return nil - } - return o.LedgerAccount -} - -func (o *PurchaseOrderInput) GetTemplateID() *string { - if o == nil { - return nil - } - return o.TemplateID -} - -func (o *PurchaseOrderInput) GetDiscountPercentage() *float64 { - if o == nil { - return nil - } - return o.DiscountPercentage -} - -func (o *PurchaseOrderInput) GetBankAccount() *BankAccount { - if o == nil { - return nil - } - return o.BankAccount -} - -func (o *PurchaseOrderInput) GetAccountingByRow() *bool { - if o == nil { - return nil - } - return o.AccountingByRow -} - -func (o *PurchaseOrderInput) GetDueDate() *types.Date { - if o == nil { - return nil - } - return o.DueDate -} - -func (o *PurchaseOrderInput) GetPaymentMethod() *string { - if o == nil { - return nil - } - return o.PaymentMethod -} - -func (o *PurchaseOrderInput) GetTaxCode() *string { - if o == nil { - return nil - } - return o.TaxCode -} - -func (o *PurchaseOrderInput) GetChannel() *string { - if o == nil { - return nil - } - return o.Channel -} - -func (o *PurchaseOrderInput) GetMemo() *string { - if o == nil { - return nil - } - return o.Memo -} - -func (o *PurchaseOrderInput) GetTrackingCategories() []*LinkedTrackingCategory { - if o == nil { - return nil - } - return o.TrackingCategories -} - -func (o *PurchaseOrderInput) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *PurchaseOrderInput) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *PurchaseOrderInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/purchaseordersfilter.go b/tests/mockserver/internal/sdk/models/components/purchaseordersfilter.go deleted file mode 100644 index bf4166b3..00000000 --- a/tests/mockserver/internal/sdk/models/components/purchaseordersfilter.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type PurchaseOrdersFilter struct { - UpdatedSince *time.Time `queryParam:"name=updated_since"` - SupplierID *string `queryParam:"name=supplier_id"` -} - -func (p PurchaseOrdersFilter) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *PurchaseOrdersFilter) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { - return err - } - return nil -} - -func (o *PurchaseOrdersFilter) GetUpdatedSince() *time.Time { - if o == nil { - return nil - } - return o.UpdatedSince -} - -func (o *PurchaseOrdersFilter) GetSupplierID() *string { - if o == nil { - return nil - } - return o.SupplierID -} diff --git a/tests/mockserver/internal/sdk/models/components/purchaseorderssort.go b/tests/mockserver/internal/sdk/models/components/purchaseorderssort.go deleted file mode 100644 index fa748e62..00000000 --- a/tests/mockserver/internal/sdk/models/components/purchaseorderssort.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// PurchaseOrdersSortBy - The field on which to sort the Purchase Orders -type PurchaseOrdersSortBy string - -const ( - PurchaseOrdersSortByUpdatedAt PurchaseOrdersSortBy = "updated_at" - PurchaseOrdersSortByCreatedAt PurchaseOrdersSortBy = "created_at" -) - -func (e PurchaseOrdersSortBy) ToPointer() *PurchaseOrdersSortBy { - return &e -} -func (e *PurchaseOrdersSortBy) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "updated_at": - fallthrough - case "created_at": - *e = PurchaseOrdersSortBy(v) - return nil - default: - return fmt.Errorf("invalid value for PurchaseOrdersSortBy: %v", v) - } -} - -type PurchaseOrdersSort struct { - // The field on which to sort the Purchase Orders - By *PurchaseOrdersSortBy `queryParam:"name=by"` - // The direction in which to sort the results - Direction *SortDirection `default:"asc" queryParam:"name=direction"` -} - -func (p PurchaseOrdersSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *PurchaseOrdersSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { - return err - } - return nil -} - -func (o *PurchaseOrdersSort) GetBy() *PurchaseOrdersSortBy { - if o == nil { - return nil - } - return o.By -} - -func (o *PurchaseOrdersSort) GetDirection() *SortDirection { - if o == nil { - return nil - } - return o.Direction -} diff --git a/tests/mockserver/internal/sdk/models/components/requestcountallocation.go b/tests/mockserver/internal/sdk/models/components/requestcountallocation.go deleted file mode 100644 index 765a12d5..00000000 --- a/tests/mockserver/internal/sdk/models/components/requestcountallocation.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type RequestCountAllocation struct { - Unify *float64 `json:"unify,omitempty"` - Proxy *float64 `json:"proxy,omitempty"` - Vault *float64 `json:"vault,omitempty"` -} - -func (o *RequestCountAllocation) GetUnify() *float64 { - if o == nil { - return nil - } - return o.Unify -} - -func (o *RequestCountAllocation) GetProxy() *float64 { - if o == nil { - return nil - } - return o.Proxy -} - -func (o *RequestCountAllocation) GetVault() *float64 { - if o == nil { - return nil - } - return o.Vault -} diff --git a/tests/mockserver/internal/sdk/models/components/resourcestatus.go b/tests/mockserver/internal/sdk/models/components/resourcestatus.go deleted file mode 100644 index ac6b6075..00000000 --- a/tests/mockserver/internal/sdk/models/components/resourcestatus.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// ResourceStatus - Status of the resource. Resources with status live or beta are callable. -type ResourceStatus string - -const ( - ResourceStatusLive ResourceStatus = "live" - ResourceStatusBeta ResourceStatus = "beta" - ResourceStatusDevelopment ResourceStatus = "development" - ResourceStatusUpcoming ResourceStatus = "upcoming" - ResourceStatusConsidering ResourceStatus = "considering" -) - -func (e ResourceStatus) ToPointer() *ResourceStatus { - return &e -} -func (e *ResourceStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "live": - fallthrough - case "beta": - fallthrough - case "development": - fallthrough - case "upcoming": - fallthrough - case "considering": - *e = ResourceStatus(v) - return nil - default: - return fmt.Errorf("invalid value for ResourceStatus: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/schedule.go b/tests/mockserver/internal/sdk/models/components/schedule.go deleted file mode 100644 index 1b30badd..00000000 --- a/tests/mockserver/internal/sdk/models/components/schedule.go +++ /dev/null @@ -1,178 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type OddWeeks struct { - HoursMonday *float64 `json:"hours_monday,omitempty"` - HoursTuesday *float64 `json:"hours_tuesday,omitempty"` - HoursWednesday *float64 `json:"hours_wednesday,omitempty"` - HoursThursday *float64 `json:"hours_thursday,omitempty"` - HoursFriday *float64 `json:"hours_friday,omitempty"` - HoursSaturday *float64 `json:"hours_saturday,omitempty"` - HoursSunday *float64 `json:"hours_sunday,omitempty"` -} - -func (o *OddWeeks) GetHoursMonday() *float64 { - if o == nil { - return nil - } - return o.HoursMonday -} - -func (o *OddWeeks) GetHoursTuesday() *float64 { - if o == nil { - return nil - } - return o.HoursTuesday -} - -func (o *OddWeeks) GetHoursWednesday() *float64 { - if o == nil { - return nil - } - return o.HoursWednesday -} - -func (o *OddWeeks) GetHoursThursday() *float64 { - if o == nil { - return nil - } - return o.HoursThursday -} - -func (o *OddWeeks) GetHoursFriday() *float64 { - if o == nil { - return nil - } - return o.HoursFriday -} - -func (o *OddWeeks) GetHoursSaturday() *float64 { - if o == nil { - return nil - } - return o.HoursSaturday -} - -func (o *OddWeeks) GetHoursSunday() *float64 { - if o == nil { - return nil - } - return o.HoursSunday -} - -type EvenWeeks struct { - HoursMonday *float64 `json:"hours_monday,omitempty"` - HoursTuesday *float64 `json:"hours_tuesday,omitempty"` - HoursWednesday *float64 `json:"hours_wednesday,omitempty"` - HoursThursday *float64 `json:"hours_thursday,omitempty"` - HoursFriday *float64 `json:"hours_friday,omitempty"` - HoursSaturday *float64 `json:"hours_saturday,omitempty"` - HoursSunday *float64 `json:"hours_sunday,omitempty"` -} - -func (o *EvenWeeks) GetHoursMonday() *float64 { - if o == nil { - return nil - } - return o.HoursMonday -} - -func (o *EvenWeeks) GetHoursTuesday() *float64 { - if o == nil { - return nil - } - return o.HoursTuesday -} - -func (o *EvenWeeks) GetHoursWednesday() *float64 { - if o == nil { - return nil - } - return o.HoursWednesday -} - -func (o *EvenWeeks) GetHoursThursday() *float64 { - if o == nil { - return nil - } - return o.HoursThursday -} - -func (o *EvenWeeks) GetHoursFriday() *float64 { - if o == nil { - return nil - } - return o.HoursFriday -} - -func (o *EvenWeeks) GetHoursSaturday() *float64 { - if o == nil { - return nil - } - return o.HoursSaturday -} - -func (o *EvenWeeks) GetHoursSunday() *float64 { - if o == nil { - return nil - } - return o.HoursSunday -} - -type WorkPattern struct { - OddWeeks *OddWeeks `json:"odd_weeks,omitempty"` - EvenWeeks *EvenWeeks `json:"even_weeks,omitempty"` -} - -func (o *WorkPattern) GetOddWeeks() *OddWeeks { - if o == nil { - return nil - } - return o.OddWeeks -} - -func (o *WorkPattern) GetEvenWeeks() *EvenWeeks { - if o == nil { - return nil - } - return o.EvenWeeks -} - -type Schedule struct { - // A unique identifier for an object. - ID string `json:"id"` - // The start date, inclusive, of the schedule period. - StartDate string `json:"start_date"` - // The end date, inclusive, of the schedule period. - EndDate string `json:"end_date"` - WorkPattern WorkPattern `json:"work_pattern"` -} - -func (o *Schedule) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *Schedule) GetStartDate() string { - if o == nil { - return "" - } - return o.StartDate -} - -func (o *Schedule) GetEndDate() string { - if o == nil { - return "" - } - return o.EndDate -} - -func (o *Schedule) GetWorkPattern() WorkPattern { - if o == nil { - return WorkPattern{} - } - return o.WorkPattern -} diff --git a/tests/mockserver/internal/sdk/models/components/schemasupport.go b/tests/mockserver/internal/sdk/models/components/schemasupport.go deleted file mode 100644 index 08af736e..00000000 --- a/tests/mockserver/internal/sdk/models/components/schemasupport.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// SchemaSupport - When a connector has schema_support, a call can be made to retrieve a json schema that describes a downstream resource. -type SchemaSupport struct { - // Can a resource schema be retrieved for this connector? - Supported *bool `json:"supported,omitempty"` -} - -func (o *SchemaSupport) GetSupported() *bool { - if o == nil { - return nil - } - return o.Supported -} diff --git a/tests/mockserver/internal/sdk/models/components/security.go b/tests/mockserver/internal/sdk/models/components/security.go deleted file mode 100644 index d518b023..00000000 --- a/tests/mockserver/internal/sdk/models/components/security.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type Security struct { - APIKey string `security:"scheme,type=http,subtype=bearer,name=Authorization"` -} - -func (o *Security) GetAPIKey() string { - if o == nil { - return "" - } - return o.APIKey -} diff --git a/tests/mockserver/internal/sdk/models/components/session.go b/tests/mockserver/internal/sdk/models/components/session.go deleted file mode 100644 index 7e9746cd..00000000 --- a/tests/mockserver/internal/sdk/models/components/session.go +++ /dev/null @@ -1,281 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -type AllowAction string - -const ( - AllowActionDelete AllowAction = "delete" - AllowActionDisconnect AllowAction = "disconnect" - AllowActionReauthorize AllowAction = "reauthorize" - AllowActionDisable AllowAction = "disable" -) - -func (e AllowAction) ToPointer() *AllowAction { - return &e -} -func (e *AllowAction) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "delete": - fallthrough - case "disconnect": - fallthrough - case "reauthorize": - fallthrough - case "disable": - *e = AllowAction(v) - return nil - default: - return fmt.Errorf("invalid value for AllowAction: %v", v) - } -} - -// Settings to change the way the Vault is displayed. -type Settings struct { - // Provide the IDs of the Unified APIs you want to be visible. Leaving it empty or omitting this field will show all Unified APIs. - UnifiedApis []UnifiedAPIID `json:"unified_apis,omitempty"` - // A boolean that controls the display of the configurable resources for an integration. When set to true, the resource configuration options will be hidden and not shown to the user. When set to false, the resource configuration options will be displayed to the user. - HideResourceSettings *bool `default:"false" json:"hide_resource_settings"` - // Configure [Vault](/apis/vault/reference#section/Get-Started) to show a banner informing the logged in user is in a test environment. - SandboxMode *bool `default:"false" json:"sandbox_mode"` - // Configure [Vault](/apis/vault/reference#section/Get-Started) to run in isolation mode, meaning it only shows the connection settings and hides the navigation items. - IsolationMode *bool `default:"false" json:"isolation_mode"` - // The duration of time the session is valid for (maximum 1 week). - SessionLength *string `default:"1h" json:"session_length"` - // Configure [Vault](/apis/vault/reference#section/Get-Started) to show the logs page. Defaults to `true`. - ShowLogs *bool `default:"true" json:"show_logs"` - // Configure [Vault](/apis/vault/reference#section/Get-Started) to show the suggestions page. Defaults to `false`. - ShowSuggestions *bool `default:"false" json:"show_suggestions"` - // Configure [Vault](/apis/vault/reference#section/Get-Started) to show the sidebar. Defaults to `true`. - ShowSidebar *bool `default:"true" json:"show_sidebar"` - // Automatically redirect to redirect uri after the connection has been configured as callable. Defaults to `false`. - AutoRedirect *bool `default:"false" json:"auto_redirect"` - // Hide Apideck connection guides in [Vault](/apis/vault/reference#section/Get-Started). Defaults to `false`. - HideGuides *bool `default:"false" json:"hide_guides"` - // Hide actions from your users in [Vault](/apis/vault/reference#section/Get-Started). Actions in `allow_actions` will be shown on a connection in Vault. - // Available actions are: `delete`, `disconnect`, `reauthorize` and `disable`. - // Empty array will hide all actions. By default all actions are visible. - AllowActions []AllowAction `json:"allow_actions,omitempty"` -} - -func (s Settings) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(s, "", false) -} - -func (s *Settings) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Settings) GetUnifiedApis() []UnifiedAPIID { - if o == nil { - return nil - } - return o.UnifiedApis -} - -func (o *Settings) GetHideResourceSettings() *bool { - if o == nil { - return nil - } - return o.HideResourceSettings -} - -func (o *Settings) GetSandboxMode() *bool { - if o == nil { - return nil - } - return o.SandboxMode -} - -func (o *Settings) GetIsolationMode() *bool { - if o == nil { - return nil - } - return o.IsolationMode -} - -func (o *Settings) GetSessionLength() *string { - if o == nil { - return nil - } - return o.SessionLength -} - -func (o *Settings) GetShowLogs() *bool { - if o == nil { - return nil - } - return o.ShowLogs -} - -func (o *Settings) GetShowSuggestions() *bool { - if o == nil { - return nil - } - return o.ShowSuggestions -} - -func (o *Settings) GetShowSidebar() *bool { - if o == nil { - return nil - } - return o.ShowSidebar -} - -func (o *Settings) GetAutoRedirect() *bool { - if o == nil { - return nil - } - return o.AutoRedirect -} - -func (o *Settings) GetHideGuides() *bool { - if o == nil { - return nil - } - return o.HideGuides -} - -func (o *Settings) GetAllowActions() []AllowAction { - if o == nil { - return nil - } - return o.AllowActions -} - -// Theme - Theming options to change the look and feel of Vault. -type Theme struct { - // The URL to the favicon to use for Vault. - Favicon *string `json:"favicon,omitempty"` - // The URL to the logo to use for Vault. - Logo *string `json:"logo,omitempty"` - // The primary color to use for Vault. - PrimaryColor *string `json:"primary_color,omitempty"` - // The background color to use for the sidebar. - SidepanelBackgroundColor *string `json:"sidepanel_background_color,omitempty"` - // The text color to use for the sidebar. - SidepanelTextColor *string `json:"sidepanel_text_color,omitempty"` - // The name that will be shown in the sidebar. - VaultName *string `json:"vault_name,omitempty"` - // The URL to the privacy policy that will be shown in the sidebar. - PrivacyURL *string `json:"privacy_url,omitempty"` - // The URL to the terms and conditions that will be shown in the sidebar. - TermsURL *string `json:"terms_url,omitempty"` -} - -func (o *Theme) GetFavicon() *string { - if o == nil { - return nil - } - return o.Favicon -} - -func (o *Theme) GetLogo() *string { - if o == nil { - return nil - } - return o.Logo -} - -func (o *Theme) GetPrimaryColor() *string { - if o == nil { - return nil - } - return o.PrimaryColor -} - -func (o *Theme) GetSidepanelBackgroundColor() *string { - if o == nil { - return nil - } - return o.SidepanelBackgroundColor -} - -func (o *Theme) GetSidepanelTextColor() *string { - if o == nil { - return nil - } - return o.SidepanelTextColor -} - -func (o *Theme) GetVaultName() *string { - if o == nil { - return nil - } - return o.VaultName -} - -func (o *Theme) GetPrivacyURL() *string { - if o == nil { - return nil - } - return o.PrivacyURL -} - -func (o *Theme) GetTermsURL() *string { - if o == nil { - return nil - } - return o.TermsURL -} - -type Session struct { - // The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. - ConsumerMetadata *ConsumerMetadata `json:"consumer_metadata,omitempty"` - // The URL to redirect the user to after the session has been configured. - RedirectURI *string `json:"redirect_uri,omitempty"` - // Settings to change the way the Vault is displayed. - Settings *Settings `json:"settings,omitempty"` - // Theming options to change the look and feel of Vault. - Theme *Theme `json:"theme,omitempty"` - // Custom consumer settings that are passed as part of the session. - CustomConsumerSettings map[string]any `json:"custom_consumer_settings,omitempty"` -} - -func (o *Session) GetConsumerMetadata() *ConsumerMetadata { - if o == nil { - return nil - } - return o.ConsumerMetadata -} - -func (o *Session) GetRedirectURI() *string { - if o == nil { - return nil - } - return o.RedirectURI -} - -func (o *Session) GetSettings() *Settings { - if o == nil { - return nil - } - return o.Settings -} - -func (o *Session) GetTheme() *Theme { - if o == nil { - return nil - } - return o.Theme -} - -func (o *Session) GetCustomConsumerSettings() map[string]any { - if o == nil { - return nil - } - return o.CustomConsumerSettings -} diff --git a/tests/mockserver/internal/sdk/models/components/sharedlinkoutput.go b/tests/mockserver/internal/sdk/models/components/sharedlinkoutput.go deleted file mode 100644 index 54ac2419..00000000 --- a/tests/mockserver/internal/sdk/models/components/sharedlinkoutput.go +++ /dev/null @@ -1,178 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// Scope - The scope of the shared link. -type Scope string - -const ( - ScopePublic Scope = "public" - ScopeCompany Scope = "company" -) - -func (e Scope) ToPointer() *Scope { - return &e -} -func (e *Scope) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "public": - fallthrough - case "company": - *e = Scope(v) - return nil - default: - return fmt.Errorf("invalid value for Scope: %v", v) - } -} - -type SharedLinkOutput struct { - // The URL that can be used to view the file. - URL *string `json:"url,omitempty"` - // The URL that can be used to download the file. - DownloadURL *string `json:"download_url,omitempty"` - Target *SharedLinkTarget `json:"target,omitempty"` - // The scope of the shared link. - Scope *Scope `json:"scope,omitempty"` - // Indicated if the shared link is password protected. - PasswordProtected *bool `json:"password_protected,omitempty"` - ExpiresAt *time.Time `json:"expires_at,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (s SharedLinkOutput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(s, "", false) -} - -func (s *SharedLinkOutput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil { - return err - } - return nil -} - -func (o *SharedLinkOutput) GetURL() *string { - if o == nil { - return nil - } - return o.URL -} - -func (o *SharedLinkOutput) GetDownloadURL() *string { - if o == nil { - return nil - } - return o.DownloadURL -} - -func (o *SharedLinkOutput) GetTarget() *SharedLinkTarget { - if o == nil { - return nil - } - return o.Target -} - -func (o *SharedLinkOutput) GetScope() *Scope { - if o == nil { - return nil - } - return o.Scope -} - -func (o *SharedLinkOutput) GetPasswordProtected() *bool { - if o == nil { - return nil - } - return o.PasswordProtected -} - -func (o *SharedLinkOutput) GetExpiresAt() *time.Time { - if o == nil { - return nil - } - return o.ExpiresAt -} - -func (o *SharedLinkOutput) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *SharedLinkOutput) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *SharedLinkOutput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type SharedLinkInput struct { - // The URL that can be used to download the file. - DownloadURL *string `json:"download_url,omitempty"` - // The ID of the file or folder to link. - TargetID *string `json:"target_id"` - // The scope of the shared link. - Scope *Scope `json:"scope,omitempty"` - // Optional password for the shared link. - Password *string `json:"password,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *SharedLinkInput) GetDownloadURL() *string { - if o == nil { - return nil - } - return o.DownloadURL -} - -func (o *SharedLinkInput) GetTargetID() *string { - if o == nil { - return nil - } - return o.TargetID -} - -func (o *SharedLinkInput) GetScope() *Scope { - if o == nil { - return nil - } - return o.Scope -} - -func (o *SharedLinkInput) GetPassword() *string { - if o == nil { - return nil - } - return o.Password -} - -func (o *SharedLinkInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/sharedlinktarget.go b/tests/mockserver/internal/sdk/models/components/sharedlinktarget.go deleted file mode 100644 index 173f2d0d..00000000 --- a/tests/mockserver/internal/sdk/models/components/sharedlinktarget.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type SharedLinkTarget struct { - // A unique identifier for an object. - ID string `json:"id"` - // The name of the file - Name *string `json:"name,omitempty"` - // The type of resource. Could be file, folder or url - Type *FileType `json:"type,omitempty"` -} - -func (o *SharedLinkTarget) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *SharedLinkTarget) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *SharedLinkTarget) GetType() *FileType { - if o == nil { - return nil - } - return o.Type -} diff --git a/tests/mockserver/internal/sdk/models/components/simpleformfieldoption.go b/tests/mockserver/internal/sdk/models/components/simpleformfieldoption.go deleted file mode 100644 index b65a7aed..00000000 --- a/tests/mockserver/internal/sdk/models/components/simpleformfieldoption.go +++ /dev/null @@ -1,274 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "errors" - "fmt" - "mockserver/internal/sdk/utils" -) - -type SimpleFormFieldOptionValue1Type string - -const ( - SimpleFormFieldOptionValue1TypeStr SimpleFormFieldOptionValue1Type = "str" - SimpleFormFieldOptionValue1TypeInteger SimpleFormFieldOptionValue1Type = "integer" - SimpleFormFieldOptionValue1TypeNumber SimpleFormFieldOptionValue1Type = "number" -) - -type SimpleFormFieldOptionValue1 struct { - Str *string `queryParam:"inline"` - Integer *int64 `queryParam:"inline"` - Number *float64 `queryParam:"inline"` - - Type SimpleFormFieldOptionValue1Type -} - -func CreateSimpleFormFieldOptionValue1Str(str string) SimpleFormFieldOptionValue1 { - typ := SimpleFormFieldOptionValue1TypeStr - - return SimpleFormFieldOptionValue1{ - Str: &str, - Type: typ, - } -} - -func CreateSimpleFormFieldOptionValue1Integer(integer int64) SimpleFormFieldOptionValue1 { - typ := SimpleFormFieldOptionValue1TypeInteger - - return SimpleFormFieldOptionValue1{ - Integer: &integer, - Type: typ, - } -} - -func CreateSimpleFormFieldOptionValue1Number(number float64) SimpleFormFieldOptionValue1 { - typ := SimpleFormFieldOptionValue1TypeNumber - - return SimpleFormFieldOptionValue1{ - Number: &number, - Type: typ, - } -} - -func (u *SimpleFormFieldOptionValue1) UnmarshalJSON(data []byte) error { - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = SimpleFormFieldOptionValue1TypeStr - return nil - } - - var integer int64 = int64(0) - if err := utils.UnmarshalJSON(data, &integer, "", true, true); err == nil { - u.Integer = &integer - u.Type = SimpleFormFieldOptionValue1TypeInteger - return nil - } - - var number float64 = float64(0) - if err := utils.UnmarshalJSON(data, &number, "", true, true); err == nil { - u.Number = &number - u.Type = SimpleFormFieldOptionValue1TypeNumber - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for SimpleFormFieldOptionValue1", string(data)) -} - -func (u SimpleFormFieldOptionValue1) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.Integer != nil { - return utils.MarshalJSON(u.Integer, "", true) - } - - if u.Number != nil { - return utils.MarshalJSON(u.Number, "", true) - } - - return nil, errors.New("could not marshal union type SimpleFormFieldOptionValue1: all fields are null") -} - -type SimpleFormFieldOptionValue2Type string - -const ( - SimpleFormFieldOptionValue2TypeStr SimpleFormFieldOptionValue2Type = "str" - SimpleFormFieldOptionValue2TypeInteger SimpleFormFieldOptionValue2Type = "integer" - SimpleFormFieldOptionValue2TypeNumber SimpleFormFieldOptionValue2Type = "number" - SimpleFormFieldOptionValue2TypeBoolean SimpleFormFieldOptionValue2Type = "boolean" - SimpleFormFieldOptionValue2TypeArrayOfSimpleFormFieldOptionValue1 SimpleFormFieldOptionValue2Type = "arrayOfSimpleFormFieldOptionValue1" -) - -type SimpleFormFieldOptionValue2 struct { - Str *string `queryParam:"inline"` - Integer *int64 `queryParam:"inline"` - Number *float64 `queryParam:"inline"` - Boolean *bool `queryParam:"inline"` - ArrayOfSimpleFormFieldOptionValue1 []SimpleFormFieldOptionValue1 `queryParam:"inline"` - - Type SimpleFormFieldOptionValue2Type -} - -func CreateSimpleFormFieldOptionValue2Str(str string) SimpleFormFieldOptionValue2 { - typ := SimpleFormFieldOptionValue2TypeStr - - return SimpleFormFieldOptionValue2{ - Str: &str, - Type: typ, - } -} - -func CreateSimpleFormFieldOptionValue2Integer(integer int64) SimpleFormFieldOptionValue2 { - typ := SimpleFormFieldOptionValue2TypeInteger - - return SimpleFormFieldOptionValue2{ - Integer: &integer, - Type: typ, - } -} - -func CreateSimpleFormFieldOptionValue2Number(number float64) SimpleFormFieldOptionValue2 { - typ := SimpleFormFieldOptionValue2TypeNumber - - return SimpleFormFieldOptionValue2{ - Number: &number, - Type: typ, - } -} - -func CreateSimpleFormFieldOptionValue2Boolean(boolean bool) SimpleFormFieldOptionValue2 { - typ := SimpleFormFieldOptionValue2TypeBoolean - - return SimpleFormFieldOptionValue2{ - Boolean: &boolean, - Type: typ, - } -} - -func CreateSimpleFormFieldOptionValue2ArrayOfSimpleFormFieldOptionValue1(arrayOfSimpleFormFieldOptionValue1 []SimpleFormFieldOptionValue1) SimpleFormFieldOptionValue2 { - typ := SimpleFormFieldOptionValue2TypeArrayOfSimpleFormFieldOptionValue1 - - return SimpleFormFieldOptionValue2{ - ArrayOfSimpleFormFieldOptionValue1: arrayOfSimpleFormFieldOptionValue1, - Type: typ, - } -} - -func (u *SimpleFormFieldOptionValue2) UnmarshalJSON(data []byte) error { - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = SimpleFormFieldOptionValue2TypeStr - return nil - } - - var integer int64 = int64(0) - if err := utils.UnmarshalJSON(data, &integer, "", true, true); err == nil { - u.Integer = &integer - u.Type = SimpleFormFieldOptionValue2TypeInteger - return nil - } - - var number float64 = float64(0) - if err := utils.UnmarshalJSON(data, &number, "", true, true); err == nil { - u.Number = &number - u.Type = SimpleFormFieldOptionValue2TypeNumber - return nil - } - - var boolean bool = false - if err := utils.UnmarshalJSON(data, &boolean, "", true, true); err == nil { - u.Boolean = &boolean - u.Type = SimpleFormFieldOptionValue2TypeBoolean - return nil - } - - var arrayOfSimpleFormFieldOptionValue1 []SimpleFormFieldOptionValue1 = []SimpleFormFieldOptionValue1{} - if err := utils.UnmarshalJSON(data, &arrayOfSimpleFormFieldOptionValue1, "", true, true); err == nil { - u.ArrayOfSimpleFormFieldOptionValue1 = arrayOfSimpleFormFieldOptionValue1 - u.Type = SimpleFormFieldOptionValue2TypeArrayOfSimpleFormFieldOptionValue1 - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for SimpleFormFieldOptionValue2", string(data)) -} - -func (u SimpleFormFieldOptionValue2) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.Integer != nil { - return utils.MarshalJSON(u.Integer, "", true) - } - - if u.Number != nil { - return utils.MarshalJSON(u.Number, "", true) - } - - if u.Boolean != nil { - return utils.MarshalJSON(u.Boolean, "", true) - } - - if u.ArrayOfSimpleFormFieldOptionValue1 != nil { - return utils.MarshalJSON(u.ArrayOfSimpleFormFieldOptionValue1, "", true) - } - - return nil, errors.New("could not marshal union type SimpleFormFieldOptionValue2: all fields are null") -} - -type SimpleFormFieldOptionOptionType string - -const ( - SimpleFormFieldOptionOptionTypeSimple SimpleFormFieldOptionOptionType = "simple" -) - -func (e SimpleFormFieldOptionOptionType) ToPointer() *SimpleFormFieldOptionOptionType { - return &e -} -func (e *SimpleFormFieldOptionOptionType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "simple": - *e = SimpleFormFieldOptionOptionType(v) - return nil - default: - return fmt.Errorf("invalid value for SimpleFormFieldOptionOptionType: %v", v) - } -} - -type SimpleFormFieldOption struct { - Label string `json:"label"` - Value *SimpleFormFieldOptionValue2 `json:"value,omitempty"` - OptionType SimpleFormFieldOptionOptionType `json:"option_type"` -} - -func (o *SimpleFormFieldOption) GetLabel() string { - if o == nil { - return "" - } - return o.Label -} - -func (o *SimpleFormFieldOption) GetValue() *SimpleFormFieldOptionValue2 { - if o == nil { - return nil - } - return o.Value -} - -func (o *SimpleFormFieldOption) GetOptionType() SimpleFormFieldOptionOptionType { - if o == nil { - return SimpleFormFieldOptionOptionType("") - } - return o.OptionType -} diff --git a/tests/mockserver/internal/sdk/models/components/sociallink.go b/tests/mockserver/internal/sdk/models/components/sociallink.go deleted file mode 100644 index decb32ae..00000000 --- a/tests/mockserver/internal/sdk/models/components/sociallink.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type SocialLink struct { - // Unique identifier of the social link - ID *string `json:"id,omitempty"` - // URL of the social link, e.g. https://www.twitter.com/apideck - URL string `json:"url"` - // Type of the social link, e.g. twitter - Type *string `json:"type,omitempty"` -} - -func (o *SocialLink) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *SocialLink) GetURL() string { - if o == nil { - return "" - } - return o.URL -} - -func (o *SocialLink) GetType() *string { - if o == nil { - return nil - } - return o.Type -} diff --git a/tests/mockserver/internal/sdk/models/components/sortdirection.go b/tests/mockserver/internal/sdk/models/components/sortdirection.go deleted file mode 100644 index 3b6c1013..00000000 --- a/tests/mockserver/internal/sdk/models/components/sortdirection.go +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// SortDirection - The direction in which to sort the results -type SortDirection string - -const ( - SortDirectionAsc SortDirection = "asc" - SortDirectionDesc SortDirection = "desc" -) - -func (e SortDirection) ToPointer() *SortDirection { - return &e -} -func (e *SortDirection) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "asc": - fallthrough - case "desc": - *e = SortDirection(v) - return nil - default: - return fmt.Errorf("invalid value for SortDirection: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/status.go b/tests/mockserver/internal/sdk/models/components/status.go deleted file mode 100644 index 121631cb..00000000 --- a/tests/mockserver/internal/sdk/models/components/status.go +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// Status - The status of the webhook. -type Status string - -const ( - StatusEnabled Status = "enabled" - StatusDisabled Status = "disabled" -) - -func (e Status) ToPointer() *Status { - return &e -} -func (e *Status) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "enabled": - fallthrough - case "disabled": - *e = Status(v) - return nil - default: - return fmt.Errorf("invalid value for Status: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/subsidiary.go b/tests/mockserver/internal/sdk/models/components/subsidiary.go deleted file mode 100644 index f18b287c..00000000 --- a/tests/mockserver/internal/sdk/models/components/subsidiary.go +++ /dev/null @@ -1,198 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// SubsidiaryStatus - Based on the status some functionality is enabled or disabled. -type SubsidiaryStatus string - -const ( - SubsidiaryStatusActive SubsidiaryStatus = "active" - SubsidiaryStatusInactive SubsidiaryStatus = "inactive" -) - -func (e SubsidiaryStatus) ToPointer() *SubsidiaryStatus { - return &e -} -func (e *SubsidiaryStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "active": - fallthrough - case "inactive": - *e = SubsidiaryStatus(v) - return nil - default: - return fmt.Errorf("invalid value for SubsidiaryStatus: %v", v) - } -} - -type Subsidiary struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // A unique identifier for an object. - ParentID *string `json:"parent_id,omitempty"` - // The name of the company. - Name *string `json:"name,omitempty"` - // Based on the status some functionality is enabled or disabled. - Status *SubsidiaryStatus `json:"status,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (s Subsidiary) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(s, "", false) -} - -func (s *Subsidiary) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Subsidiary) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Subsidiary) GetParentID() *string { - if o == nil { - return nil - } - return o.ParentID -} - -func (o *Subsidiary) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *Subsidiary) GetStatus() *SubsidiaryStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *Subsidiary) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Subsidiary) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *Subsidiary) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *Subsidiary) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *Subsidiary) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Subsidiary) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Subsidiary) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type SubsidiaryInput struct { - // A unique identifier for an object. - ParentID *string `json:"parent_id,omitempty"` - // The name of the company. - Name *string `json:"name,omitempty"` - // Based on the status some functionality is enabled or disabled. - Status *SubsidiaryStatus `json:"status,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *SubsidiaryInput) GetParentID() *string { - if o == nil { - return nil - } - return o.ParentID -} - -func (o *SubsidiaryInput) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *SubsidiaryInput) GetStatus() *SubsidiaryStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *SubsidiaryInput) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *SubsidiaryInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/subsidiaryreference.go b/tests/mockserver/internal/sdk/models/components/subsidiaryreference.go deleted file mode 100644 index 5518133e..00000000 --- a/tests/mockserver/internal/sdk/models/components/subsidiaryreference.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type SubsidiaryReference struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // The name of the company. - Name *string `json:"name,omitempty"` -} - -func (o *SubsidiaryReference) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *SubsidiaryReference) GetName() *string { - if o == nil { - return nil - } - return o.Name -} diff --git a/tests/mockserver/internal/sdk/models/components/subsidiaryreferenceinput.go b/tests/mockserver/internal/sdk/models/components/subsidiaryreferenceinput.go deleted file mode 100644 index f23d232f..00000000 --- a/tests/mockserver/internal/sdk/models/components/subsidiaryreferenceinput.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type SubsidiaryReferenceInput struct { - // The name of the company. - Name *string `json:"name,omitempty"` -} - -func (o *SubsidiaryReferenceInput) GetName() *string { - if o == nil { - return nil - } - return o.Name -} diff --git a/tests/mockserver/internal/sdk/models/components/supplier.go b/tests/mockserver/internal/sdk/models/components/supplier.go deleted file mode 100644 index 0259be2c..00000000 --- a/tests/mockserver/internal/sdk/models/components/supplier.go +++ /dev/null @@ -1,610 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// SupplierStatus - Supplier status -type SupplierStatus string - -const ( - SupplierStatusActive SupplierStatus = "active" - SupplierStatusInactive SupplierStatus = "inactive" - SupplierStatusArchived SupplierStatus = "archived" - SupplierStatusGdprErasureRequest SupplierStatus = "gdpr-erasure-request" - SupplierStatusUnknown SupplierStatus = "unknown" -) - -func (e SupplierStatus) ToPointer() *SupplierStatus { - return &e -} -func (e *SupplierStatus) 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 "archived": - fallthrough - case "gdpr-erasure-request": - fallthrough - case "unknown": - *e = SupplierStatus(v) - return nil - default: - return fmt.Errorf("invalid value for SupplierStatus: %v", v) - } -} - -type Supplier struct { - // A unique identifier for an object. - ID string `json:"id"` - // The third-party API ID of original entity - DownstreamID *string `json:"downstream_id,omitempty"` - // Display ID - DisplayID *string `json:"display_id,omitempty"` - // Display name - DisplayName *string `json:"display_name,omitempty"` - // The name of the company. - CompanyName *string `json:"company_name,omitempty"` - // The company or subsidiary id the transaction belongs to - CompanyID *string `json:"company_id,omitempty"` - // The category/type of the supplier - SupplierCategory *string `json:"supplier_category,omitempty"` - // The job title of the person. - Title *string `json:"title,omitempty"` - // The first name of the person. - FirstName *string `json:"first_name,omitempty"` - // Middle name of the person. - MiddleName *string `json:"middle_name,omitempty"` - // The last name of the person. - LastName *string `json:"last_name,omitempty"` - Suffix *string `json:"suffix,omitempty"` - // Is this an individual or business supplier - Individual *bool `json:"individual,omitempty"` - Addresses []Address `json:"addresses,omitempty"` - PhoneNumbers []PhoneNumber `json:"phone_numbers,omitempty"` - Emails []Email `json:"emails,omitempty"` - Websites []Website `json:"websites,omitempty"` - BankAccounts []BankAccount `json:"bank_accounts,omitempty"` - // Some notes about this supplier - Notes *string `json:"notes,omitempty"` - TaxRate *LinkedTaxRate `json:"tax_rate,omitempty"` - TaxNumber *string `json:"tax_number,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"` - Account *LinkedLedgerAccount `json:"account,omitempty"` - // Supplier status - Status *SupplierStatus `json:"status,omitempty"` - // Payment method used for the transaction, such as cash, credit card, bank transfer, or check - PaymentMethod *string `json:"payment_method,omitempty"` - // The channel through which the transaction is processed. - Channel *string `json:"channel,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` - // The subsidiary the supplier belongs to. - SubsidiaryID *string `json:"subsidiary_id,omitempty"` -} - -func (s Supplier) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(s, "", false) -} - -func (s *Supplier) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Supplier) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *Supplier) GetDownstreamID() *string { - if o == nil { - return nil - } - return o.DownstreamID -} - -func (o *Supplier) GetDisplayID() *string { - if o == nil { - return nil - } - return o.DisplayID -} - -func (o *Supplier) GetDisplayName() *string { - if o == nil { - return nil - } - return o.DisplayName -} - -func (o *Supplier) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *Supplier) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *Supplier) GetSupplierCategory() *string { - if o == nil { - return nil - } - return o.SupplierCategory -} - -func (o *Supplier) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *Supplier) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *Supplier) GetMiddleName() *string { - if o == nil { - return nil - } - return o.MiddleName -} - -func (o *Supplier) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *Supplier) GetSuffix() *string { - if o == nil { - return nil - } - return o.Suffix -} - -func (o *Supplier) GetIndividual() *bool { - if o == nil { - return nil - } - return o.Individual -} - -func (o *Supplier) GetAddresses() []Address { - if o == nil { - return nil - } - return o.Addresses -} - -func (o *Supplier) GetPhoneNumbers() []PhoneNumber { - if o == nil { - return nil - } - return o.PhoneNumbers -} - -func (o *Supplier) GetEmails() []Email { - if o == nil { - return nil - } - return o.Emails -} - -func (o *Supplier) GetWebsites() []Website { - if o == nil { - return nil - } - return o.Websites -} - -func (o *Supplier) GetBankAccounts() []BankAccount { - if o == nil { - return nil - } - return o.BankAccounts -} - -func (o *Supplier) GetNotes() *string { - if o == nil { - return nil - } - return o.Notes -} - -func (o *Supplier) GetTaxRate() *LinkedTaxRate { - if o == nil { - return nil - } - return o.TaxRate -} - -func (o *Supplier) GetTaxNumber() *string { - if o == nil { - return nil - } - return o.TaxNumber -} - -func (o *Supplier) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *Supplier) GetAccount() *LinkedLedgerAccount { - if o == nil { - return nil - } - return o.Account -} - -func (o *Supplier) GetStatus() *SupplierStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *Supplier) GetPaymentMethod() *string { - if o == nil { - return nil - } - return o.PaymentMethod -} - -func (o *Supplier) GetChannel() *string { - if o == nil { - return nil - } - return o.Channel -} - -func (o *Supplier) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Supplier) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *Supplier) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *Supplier) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *Supplier) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Supplier) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Supplier) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *Supplier) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *Supplier) GetSubsidiaryID() *string { - if o == nil { - return nil - } - return o.SubsidiaryID -} - -type SupplierInput struct { - // Display ID - DisplayID *string `json:"display_id,omitempty"` - // Display name - DisplayName *string `json:"display_name,omitempty"` - // The name of the company. - CompanyName *string `json:"company_name,omitempty"` - // The company or subsidiary id the transaction belongs to - CompanyID *string `json:"company_id,omitempty"` - // The category/type of the supplier - SupplierCategory *string `json:"supplier_category,omitempty"` - // The job title of the person. - Title *string `json:"title,omitempty"` - // The first name of the person. - FirstName *string `json:"first_name,omitempty"` - // Middle name of the person. - MiddleName *string `json:"middle_name,omitempty"` - // The last name of the person. - LastName *string `json:"last_name,omitempty"` - Suffix *string `json:"suffix,omitempty"` - // Is this an individual or business supplier - Individual *bool `json:"individual,omitempty"` - Addresses []Address `json:"addresses,omitempty"` - PhoneNumbers []PhoneNumber `json:"phone_numbers,omitempty"` - Emails []Email `json:"emails,omitempty"` - Websites []Website `json:"websites,omitempty"` - BankAccounts []BankAccount `json:"bank_accounts,omitempty"` - // Some notes about this supplier - Notes *string `json:"notes,omitempty"` - TaxRate *LinkedTaxRateInput `json:"tax_rate,omitempty"` - TaxNumber *string `json:"tax_number,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"` - Account *LinkedLedgerAccountInput `json:"account,omitempty"` - // Supplier status - Status *SupplierStatus `json:"status,omitempty"` - // Payment method used for the transaction, such as cash, credit card, bank transfer, or check - PaymentMethod *string `json:"payment_method,omitempty"` - // The channel through which the transaction is processed. - Channel *string `json:"channel,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` - // The subsidiary the supplier belongs to. - SubsidiaryID *string `json:"subsidiary_id,omitempty"` -} - -func (o *SupplierInput) GetDisplayID() *string { - if o == nil { - return nil - } - return o.DisplayID -} - -func (o *SupplierInput) GetDisplayName() *string { - if o == nil { - return nil - } - return o.DisplayName -} - -func (o *SupplierInput) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *SupplierInput) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} - -func (o *SupplierInput) GetSupplierCategory() *string { - if o == nil { - return nil - } - return o.SupplierCategory -} - -func (o *SupplierInput) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *SupplierInput) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *SupplierInput) GetMiddleName() *string { - if o == nil { - return nil - } - return o.MiddleName -} - -func (o *SupplierInput) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *SupplierInput) GetSuffix() *string { - if o == nil { - return nil - } - return o.Suffix -} - -func (o *SupplierInput) GetIndividual() *bool { - if o == nil { - return nil - } - return o.Individual -} - -func (o *SupplierInput) GetAddresses() []Address { - if o == nil { - return nil - } - return o.Addresses -} - -func (o *SupplierInput) GetPhoneNumbers() []PhoneNumber { - if o == nil { - return nil - } - return o.PhoneNumbers -} - -func (o *SupplierInput) GetEmails() []Email { - if o == nil { - return nil - } - return o.Emails -} - -func (o *SupplierInput) GetWebsites() []Website { - if o == nil { - return nil - } - return o.Websites -} - -func (o *SupplierInput) GetBankAccounts() []BankAccount { - if o == nil { - return nil - } - return o.BankAccounts -} - -func (o *SupplierInput) GetNotes() *string { - if o == nil { - return nil - } - return o.Notes -} - -func (o *SupplierInput) GetTaxRate() *LinkedTaxRateInput { - if o == nil { - return nil - } - return o.TaxRate -} - -func (o *SupplierInput) GetTaxNumber() *string { - if o == nil { - return nil - } - return o.TaxNumber -} - -func (o *SupplierInput) GetCurrency() *Currency { - if o == nil { - return nil - } - return o.Currency -} - -func (o *SupplierInput) GetAccount() *LinkedLedgerAccountInput { - if o == nil { - return nil - } - return o.Account -} - -func (o *SupplierInput) GetStatus() *SupplierStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *SupplierInput) GetPaymentMethod() *string { - if o == nil { - return nil - } - return o.PaymentMethod -} - -func (o *SupplierInput) GetChannel() *string { - if o == nil { - return nil - } - return o.Channel -} - -func (o *SupplierInput) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -func (o *SupplierInput) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *SupplierInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *SupplierInput) GetSubsidiaryID() *string { - if o == nil { - return nil - } - return o.SubsidiaryID -} diff --git a/tests/mockserver/internal/sdk/models/components/suppliersfilter.go b/tests/mockserver/internal/sdk/models/components/suppliersfilter.go deleted file mode 100644 index 6ff6c474..00000000 --- a/tests/mockserver/internal/sdk/models/components/suppliersfilter.go +++ /dev/null @@ -1,75 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type SuppliersFilter struct { - // Company Name of supplier to search for - CompanyName *string `queryParam:"name=company_name"` - // Display Name of supplier to search for - DisplayName *string `queryParam:"name=display_name"` - // First name of supplier to search for - FirstName *string `queryParam:"name=first_name"` - // Last name of supplier to search for - LastName *string `queryParam:"name=last_name"` - // Email of supplier to search for - Email *string `queryParam:"name=email"` - UpdatedSince *time.Time `queryParam:"name=updated_since"` -} - -func (s SuppliersFilter) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(s, "", false) -} - -func (s *SuppliersFilter) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil { - return err - } - return nil -} - -func (o *SuppliersFilter) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *SuppliersFilter) GetDisplayName() *string { - if o == nil { - return nil - } - return o.DisplayName -} - -func (o *SuppliersFilter) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *SuppliersFilter) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *SuppliersFilter) GetEmail() *string { - if o == nil { - return nil - } - return o.Email -} - -func (o *SuppliersFilter) GetUpdatedSince() *time.Time { - if o == nil { - return nil - } - return o.UpdatedSince -} diff --git a/tests/mockserver/internal/sdk/models/components/supplierssort.go b/tests/mockserver/internal/sdk/models/components/supplierssort.go deleted file mode 100644 index 9f2c46d6..00000000 --- a/tests/mockserver/internal/sdk/models/components/supplierssort.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// SuppliersSortBy - The field on which to sort the Suppliers -type SuppliersSortBy string - -const ( - SuppliersSortByCreatedAt SuppliersSortBy = "created_at" - SuppliersSortByUpdatedAt SuppliersSortBy = "updated_at" -) - -func (e SuppliersSortBy) ToPointer() *SuppliersSortBy { - return &e -} -func (e *SuppliersSortBy) 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 = SuppliersSortBy(v) - return nil - default: - return fmt.Errorf("invalid value for SuppliersSortBy: %v", v) - } -} - -type SuppliersSort struct { - // The field on which to sort the Suppliers - By *SuppliersSortBy `queryParam:"name=by"` - // The direction in which to sort the results - Direction *SortDirection `default:"asc" queryParam:"name=direction"` -} - -func (s SuppliersSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(s, "", false) -} - -func (s *SuppliersSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil { - return err - } - return nil -} - -func (o *SuppliersSort) GetBy() *SuppliersSortBy { - if o == nil { - return nil - } - return o.By -} - -func (o *SuppliersSort) GetDirection() *SortDirection { - if o == nil { - return nil - } - return o.Direction -} diff --git a/tests/mockserver/internal/sdk/models/components/supportedproperty.go b/tests/mockserver/internal/sdk/models/components/supportedproperty.go deleted file mode 100644 index 633cd535..00000000 --- a/tests/mockserver/internal/sdk/models/components/supportedproperty.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type SupportedProperty struct { - // Name of the property in our Unified API. - UnifiedProperty *string `json:"unified_property,omitempty"` - // List of child properties of the unified property. - ChildProperties []SupportedProperty `json:"child_properties,omitempty"` -} - -func (o *SupportedProperty) GetUnifiedProperty() *string { - if o == nil { - return nil - } - return o.UnifiedProperty -} - -func (o *SupportedProperty) GetChildProperties() []SupportedProperty { - if o == nil { - return nil - } - return o.ChildProperties -} diff --git a/tests/mockserver/internal/sdk/models/components/tax.go b/tests/mockserver/internal/sdk/models/components/tax.go deleted file mode 100644 index 3aa3eb8c..00000000 --- a/tests/mockserver/internal/sdk/models/components/tax.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type Tax struct { - // The name of the tax. - Name *string `json:"name,omitempty"` - // Paid by employer. - Employer *bool `json:"employer,omitempty"` - // The amount of the tax. - Amount *float64 `json:"amount,omitempty"` -} - -func (o *Tax) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *Tax) GetEmployer() *bool { - if o == nil { - return nil - } - return o.Employer -} - -func (o *Tax) GetAmount() *float64 { - if o == nil { - return nil - } - return o.Amount -} diff --git a/tests/mockserver/internal/sdk/models/components/taxrate.go b/tests/mockserver/internal/sdk/models/components/taxrate.go deleted file mode 100644 index 25be2674..00000000 --- a/tests/mockserver/internal/sdk/models/components/taxrate.go +++ /dev/null @@ -1,451 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -type Component struct { - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Rate *float64 `json:"rate,omitempty"` - Compound *bool `json:"compound,omitempty"` -} - -func (o *Component) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Component) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *Component) GetRate() *float64 { - if o == nil { - return nil - } - return o.Rate -} - -func (o *Component) GetCompound() *bool { - if o == nil { - return nil - } - return o.Compound -} - -// TaxRateStatus - Tax rate status -type TaxRateStatus string - -const ( - TaxRateStatusActive TaxRateStatus = "active" - TaxRateStatusInactive TaxRateStatus = "inactive" - TaxRateStatusArchived TaxRateStatus = "archived" -) - -func (e TaxRateStatus) ToPointer() *TaxRateStatus { - return &e -} -func (e *TaxRateStatus) 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 "archived": - *e = TaxRateStatus(v) - return nil - default: - return fmt.Errorf("invalid value for TaxRateStatus: %v", v) - } -} - -type TaxRateSubsidiary struct { - // The ID of the subsidiary. - ID *string `json:"id,omitempty"` -} - -func (o *TaxRateSubsidiary) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -type TaxRate struct { - // ID assigned to identify this tax rate. - ID *string `json:"id,omitempty"` - // Name assigned to identify this tax rate. - Name *string `json:"name,omitempty"` - // Tax code assigned to identify this tax rate. - Code *string `json:"code,omitempty"` - // Description of tax rate - Description *string `json:"description,omitempty"` - // Effective tax rate - EffectiveTaxRate *float64 `json:"effective_tax_rate,omitempty"` - // Not compounded sum of the components of a tax rate - TotalTaxRate *float64 `json:"total_tax_rate,omitempty"` - // Unique identifier for the account for tax collected. - TaxPayableAccountID *string `json:"tax_payable_account_id,omitempty"` - // Unique identifier for the account for tax remitted. - TaxRemittedAccountID *string `json:"tax_remitted_account_id,omitempty"` - Components []Component `json:"components,omitempty"` - // Tax type used to indicate the source of tax collected or paid - Type *string `json:"type,omitempty"` - // Report Tax type to aggregate tax collected or paid for reporting purposes - ReportTaxType *string `json:"report_tax_type,omitempty"` - // ID of the original tax rate from which the new tax rate is derived. Helps to understand the relationship between corresponding tax rate entities. - OriginalTaxRateID *string `json:"original_tax_rate_id,omitempty"` - // Tax rate status - Status *TaxRateStatus `json:"status,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` - // The subsidiaries this belongs to. - Subsidiaries []TaxRateSubsidiary `json:"subsidiaries,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` -} - -func (t TaxRate) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(t, "", false) -} - -func (t *TaxRate) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { - return err - } - return nil -} - -func (o *TaxRate) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *TaxRate) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *TaxRate) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *TaxRate) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *TaxRate) GetEffectiveTaxRate() *float64 { - if o == nil { - return nil - } - return o.EffectiveTaxRate -} - -func (o *TaxRate) GetTotalTaxRate() *float64 { - if o == nil { - return nil - } - return o.TotalTaxRate -} - -func (o *TaxRate) GetTaxPayableAccountID() *string { - if o == nil { - return nil - } - return o.TaxPayableAccountID -} - -func (o *TaxRate) GetTaxRemittedAccountID() *string { - if o == nil { - return nil - } - return o.TaxRemittedAccountID -} - -func (o *TaxRate) GetComponents() []Component { - if o == nil { - return nil - } - return o.Components -} - -func (o *TaxRate) GetType() *string { - if o == nil { - return nil - } - return o.Type -} - -func (o *TaxRate) GetReportTaxType() *string { - if o == nil { - return nil - } - return o.ReportTaxType -} - -func (o *TaxRate) GetOriginalTaxRateID() *string { - if o == nil { - return nil - } - return o.OriginalTaxRateID -} - -func (o *TaxRate) GetStatus() *TaxRateStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *TaxRate) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *TaxRate) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *TaxRate) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *TaxRate) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *TaxRate) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *TaxRate) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *TaxRate) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *TaxRate) GetSubsidiaries() []TaxRateSubsidiary { - if o == nil { - return nil - } - return o.Subsidiaries -} - -func (o *TaxRate) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} - -type TaxRateInput struct { - // ID assigned to identify this tax rate. - ID *string `json:"id,omitempty"` - // Name assigned to identify this tax rate. - Name *string `json:"name,omitempty"` - // Tax code assigned to identify this tax rate. - Code *string `json:"code,omitempty"` - // Description of tax rate - Description *string `json:"description,omitempty"` - // Effective tax rate - EffectiveTaxRate *float64 `json:"effective_tax_rate,omitempty"` - // Not compounded sum of the components of a tax rate - TotalTaxRate *float64 `json:"total_tax_rate,omitempty"` - // Unique identifier for the account for tax collected. - TaxPayableAccountID *string `json:"tax_payable_account_id,omitempty"` - // Unique identifier for the account for tax remitted. - TaxRemittedAccountID *string `json:"tax_remitted_account_id,omitempty"` - Components []Component `json:"components,omitempty"` - // Tax type used to indicate the source of tax collected or paid - Type *string `json:"type,omitempty"` - // Report Tax type to aggregate tax collected or paid for reporting purposes - ReportTaxType *string `json:"report_tax_type,omitempty"` - // ID of the original tax rate from which the new tax rate is derived. Helps to understand the relationship between corresponding tax rate entities. - OriginalTaxRateID *string `json:"original_tax_rate_id,omitempty"` - // Tax rate status - Status *TaxRateStatus `json:"status,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` - // The subsidiaries this belongs to. - Subsidiaries []TaxRateSubsidiary `json:"subsidiaries,omitempty"` - CustomFields []CustomField `json:"custom_fields,omitempty"` -} - -func (o *TaxRateInput) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *TaxRateInput) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *TaxRateInput) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *TaxRateInput) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *TaxRateInput) GetEffectiveTaxRate() *float64 { - if o == nil { - return nil - } - return o.EffectiveTaxRate -} - -func (o *TaxRateInput) GetTotalTaxRate() *float64 { - if o == nil { - return nil - } - return o.TotalTaxRate -} - -func (o *TaxRateInput) GetTaxPayableAccountID() *string { - if o == nil { - return nil - } - return o.TaxPayableAccountID -} - -func (o *TaxRateInput) GetTaxRemittedAccountID() *string { - if o == nil { - return nil - } - return o.TaxRemittedAccountID -} - -func (o *TaxRateInput) GetComponents() []Component { - if o == nil { - return nil - } - return o.Components -} - -func (o *TaxRateInput) GetType() *string { - if o == nil { - return nil - } - return o.Type -} - -func (o *TaxRateInput) GetReportTaxType() *string { - if o == nil { - return nil - } - return o.ReportTaxType -} - -func (o *TaxRateInput) GetOriginalTaxRateID() *string { - if o == nil { - return nil - } - return o.OriginalTaxRateID -} - -func (o *TaxRateInput) GetStatus() *TaxRateStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *TaxRateInput) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *TaxRateInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *TaxRateInput) GetSubsidiaries() []TaxRateSubsidiary { - if o == nil { - return nil - } - return o.Subsidiaries -} - -func (o *TaxRateInput) GetCustomFields() []CustomField { - if o == nil { - return nil - } - return o.CustomFields -} diff --git a/tests/mockserver/internal/sdk/models/components/taxratesfilter.go b/tests/mockserver/internal/sdk/models/components/taxratesfilter.go deleted file mode 100644 index d07a31b3..00000000 --- a/tests/mockserver/internal/sdk/models/components/taxratesfilter.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type TaxRatesFilter struct { - // Boolean to describe if tax rate can be used for asset accounts - Assets *bool `queryParam:"name=assets"` - // Boolean to describe if tax rate can be used for equity accounts - Equity *bool `queryParam:"name=equity"` - // Boolean to describe if tax rate can be used for expense accounts - Expenses *bool `queryParam:"name=expenses"` - // Boolean to describe if tax rate can be used for liability accounts - Liabilities *bool `queryParam:"name=liabilities"` - // Boolean to describe if tax rate can be used for revenue accounts - Revenue *bool `queryParam:"name=revenue"` -} - -func (o *TaxRatesFilter) GetAssets() *bool { - if o == nil { - return nil - } - return o.Assets -} - -func (o *TaxRatesFilter) GetEquity() *bool { - if o == nil { - return nil - } - return o.Equity -} - -func (o *TaxRatesFilter) GetExpenses() *bool { - if o == nil { - return nil - } - return o.Expenses -} - -func (o *TaxRatesFilter) GetLiabilities() *bool { - if o == nil { - return nil - } - return o.Liabilities -} - -func (o *TaxRatesFilter) GetRevenue() *bool { - if o == nil { - return nil - } - return o.Revenue -} diff --git a/tests/mockserver/internal/sdk/models/components/team.go b/tests/mockserver/internal/sdk/models/components/team.go deleted file mode 100644 index 2fd8d5bc..00000000 --- a/tests/mockserver/internal/sdk/models/components/team.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// Team - The team the person is currently in. -type Team struct { - // The unique identifier of the team. - ID *string `json:"id,omitempty"` - // The name of the team. - Name *string `json:"name,omitempty"` -} - -func (o *Team) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Team) GetName() *string { - if o == nil { - return nil - } - return o.Name -} diff --git a/tests/mockserver/internal/sdk/models/components/ticket.go b/tests/mockserver/internal/sdk/models/components/ticket.go deleted file mode 100644 index cb4e4492..00000000 --- a/tests/mockserver/internal/sdk/models/components/ticket.go +++ /dev/null @@ -1,310 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// Priority of the ticket -type Priority string - -const ( - PriorityLow Priority = "low" - PriorityNormal Priority = "normal" - PriorityHigh Priority = "high" - PriorityUrgent Priority = "urgent" -) - -func (e Priority) ToPointer() *Priority { - return &e -} -func (e *Priority) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "low": - fallthrough - case "normal": - fallthrough - case "high": - fallthrough - case "urgent": - *e = Priority(v) - return nil - default: - return fmt.Errorf("invalid value for Priority: %v", v) - } -} - -type Ticket struct { - // A unique identifier for an object. - ID string `json:"id"` - // The ticket's parent ID - ParentID *string `json:"parent_id,omitempty"` - // The ticket's collection ID - CollectionID *string `json:"collection_id,omitempty"` - // The ticket's type - Type *string `json:"type,omitempty"` - // Subject of the ticket - Subject *string `json:"subject,omitempty"` - // The ticket's description. HTML version of description is mapped if supported by the third-party platform - Description *string `json:"description,omitempty"` - // The current status of the ticket. Possible values include: open, in_progress, closed, or - in cases where there is no clear mapping - the original value passed through. - Status *string `json:"status,omitempty"` - // Priority of the ticket - Priority *Priority `json:"priority,omitempty"` - Assignees []Assignee `json:"assignees,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // Due date of the ticket - DueDate *time.Time `json:"due_date,omitempty"` - // When the ticket was completed - CompletedAt *time.Time `json:"completed_at,omitempty"` - Tags []CollectionTag `json:"tags,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (t Ticket) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(t, "", false) -} - -func (t *Ticket) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Ticket) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *Ticket) GetParentID() *string { - if o == nil { - return nil - } - return o.ParentID -} - -func (o *Ticket) GetCollectionID() *string { - if o == nil { - return nil - } - return o.CollectionID -} - -func (o *Ticket) GetType() *string { - if o == nil { - return nil - } - return o.Type -} - -func (o *Ticket) GetSubject() *string { - if o == nil { - return nil - } - return o.Subject -} - -func (o *Ticket) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *Ticket) GetStatus() *string { - if o == nil { - return nil - } - return o.Status -} - -func (o *Ticket) GetPriority() *Priority { - if o == nil { - return nil - } - return o.Priority -} - -func (o *Ticket) GetAssignees() []Assignee { - if o == nil { - return nil - } - return o.Assignees -} - -func (o *Ticket) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Ticket) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *Ticket) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *Ticket) GetDueDate() *time.Time { - if o == nil { - return nil - } - return o.DueDate -} - -func (o *Ticket) GetCompletedAt() *time.Time { - if o == nil { - return nil - } - return o.CompletedAt -} - -func (o *Ticket) GetTags() []CollectionTag { - if o == nil { - return nil - } - return o.Tags -} - -func (o *Ticket) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *Ticket) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -type TicketInput struct { - // The ticket's parent ID - ParentID *string `json:"parent_id,omitempty"` - // The ticket's type - Type *string `json:"type,omitempty"` - // Subject of the ticket - Subject *string `json:"subject,omitempty"` - // The ticket's description. HTML version of description is mapped if supported by the third-party platform - Description *string `json:"description,omitempty"` - // The current status of the ticket. Possible values include: open, in_progress, closed, or - in cases where there is no clear mapping - the original value passed through. - Status *string `json:"status,omitempty"` - // Priority of the ticket - Priority *Priority `json:"priority,omitempty"` - Assignees []AssigneeInput `json:"assignees,omitempty"` - // Due date of the ticket - DueDate *time.Time `json:"due_date,omitempty"` - Tags []CollectionTagInput `json:"tags,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (t TicketInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(t, "", false) -} - -func (t *TicketInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { - return err - } - return nil -} - -func (o *TicketInput) GetParentID() *string { - if o == nil { - return nil - } - return o.ParentID -} - -func (o *TicketInput) GetType() *string { - if o == nil { - return nil - } - return o.Type -} - -func (o *TicketInput) GetSubject() *string { - if o == nil { - return nil - } - return o.Subject -} - -func (o *TicketInput) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *TicketInput) GetStatus() *string { - if o == nil { - return nil - } - return o.Status -} - -func (o *TicketInput) GetPriority() *Priority { - if o == nil { - return nil - } - return o.Priority -} - -func (o *TicketInput) GetAssignees() []AssigneeInput { - if o == nil { - return nil - } - return o.Assignees -} - -func (o *TicketInput) GetDueDate() *time.Time { - if o == nil { - return nil - } - return o.DueDate -} - -func (o *TicketInput) GetTags() []CollectionTagInput { - if o == nil { - return nil - } - return o.Tags -} - -func (o *TicketInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/ticketssort.go b/tests/mockserver/internal/sdk/models/components/ticketssort.go deleted file mode 100644 index 867f32fc..00000000 --- a/tests/mockserver/internal/sdk/models/components/ticketssort.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// TicketsSortBy - The field on which to sort the Tickets -type TicketsSortBy string - -const ( - TicketsSortByCreatedAt TicketsSortBy = "created_at" - TicketsSortByUpdatedAt TicketsSortBy = "updated_at" -) - -func (e TicketsSortBy) ToPointer() *TicketsSortBy { - return &e -} -func (e *TicketsSortBy) 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 = TicketsSortBy(v) - return nil - default: - return fmt.Errorf("invalid value for TicketsSortBy: %v", v) - } -} - -type TicketsSort struct { - // The field on which to sort the Tickets - By *TicketsSortBy `queryParam:"name=by"` - // The direction in which to sort the results - Direction *SortDirection `default:"asc" queryParam:"name=direction"` -} - -func (t TicketsSort) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(t, "", false) -} - -func (t *TicketsSort) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { - return err - } - return nil -} - -func (o *TicketsSort) GetBy() *TicketsSortBy { - if o == nil { - return nil - } - return o.By -} - -func (o *TicketsSort) GetDirection() *SortDirection { - if o == nil { - return nil - } - return o.Direction -} diff --git a/tests/mockserver/internal/sdk/models/components/timeoffrequest.go b/tests/mockserver/internal/sdk/models/components/timeoffrequest.go deleted file mode 100644 index 553498a3..00000000 --- a/tests/mockserver/internal/sdk/models/components/timeoffrequest.go +++ /dev/null @@ -1,479 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// TimeOffRequestStatus - The status of the time off request. -type TimeOffRequestStatus string - -const ( - TimeOffRequestStatusRequested TimeOffRequestStatus = "requested" - TimeOffRequestStatusApproved TimeOffRequestStatus = "approved" - TimeOffRequestStatusDeclined TimeOffRequestStatus = "declined" - TimeOffRequestStatusCancelled TimeOffRequestStatus = "cancelled" - TimeOffRequestStatusDeleted TimeOffRequestStatus = "deleted" - TimeOffRequestStatusOther TimeOffRequestStatus = "other" -) - -func (e TimeOffRequestStatus) ToPointer() *TimeOffRequestStatus { - return &e -} -func (e *TimeOffRequestStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "requested": - fallthrough - case "approved": - fallthrough - case "declined": - fallthrough - case "cancelled": - fallthrough - case "deleted": - fallthrough - case "other": - *e = TimeOffRequestStatus(v) - return nil - default: - return fmt.Errorf("invalid value for TimeOffRequestStatus: %v", v) - } -} - -// RequestType - The type of request -type RequestType string - -const ( - RequestTypeVacation RequestType = "vacation" - RequestTypeSick RequestType = "sick" - RequestTypePersonal RequestType = "personal" - RequestTypeJuryDuty RequestType = "jury_duty" - RequestTypeVolunteer RequestType = "volunteer" - RequestTypeBereavement RequestType = "bereavement" - RequestTypeOther RequestType = "other" -) - -func (e RequestType) ToPointer() *RequestType { - return &e -} -func (e *RequestType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "vacation": - fallthrough - case "sick": - fallthrough - case "personal": - fallthrough - case "jury_duty": - fallthrough - case "volunteer": - fallthrough - case "bereavement": - fallthrough - case "other": - *e = RequestType(v) - return nil - default: - return fmt.Errorf("invalid value for RequestType: %v", v) - } -} - -// Units - The unit of time off requested. Possible values include: `hours`, `days`, or `other`. -type Units string - -const ( - UnitsDays Units = "days" - UnitsHours Units = "hours" - UnitsOther Units = "other" -) - -func (e Units) ToPointer() *Units { - return &e -} -func (e *Units) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "days": - fallthrough - case "hours": - fallthrough - case "other": - *e = Units(v) - return nil - default: - return fmt.Errorf("invalid value for Units: %v", v) - } -} - -type Notes struct { - Employee *string `json:"employee,omitempty"` - Manager *string `json:"manager,omitempty"` -} - -func (o *Notes) GetEmployee() *string { - if o == nil { - return nil - } - return o.Employee -} - -func (o *Notes) GetManager() *string { - if o == nil { - return nil - } - return o.Manager -} - -type TimeOffRequest struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // ID of the employee - EmployeeID *string `json:"employee_id,omitempty"` - // ID of the policy - PolicyID *string `json:"policy_id,omitempty"` - // The status of the time off request. - Status *TimeOffRequestStatus `json:"status,omitempty"` - // Description of the time off request. - Description *string `json:"description,omitempty"` - // The start date of the time off request. - StartDate *string `json:"start_date,omitempty"` - // The end date of the time off request. - EndDate *string `json:"end_date,omitempty"` - // The date the request was made. - RequestDate *string `json:"request_date,omitempty"` - // The type of request - RequestType *RequestType `json:"request_type,omitempty"` - // The date the request was approved - ApprovalDate *string `json:"approval_date,omitempty"` - // The unit of time off requested. Possible values include: `hours`, `days`, or `other`. - Units *Units `json:"units,omitempty"` - // The amount of time off requested. - Amount *float64 `json:"amount,omitempty"` - // The day part of the time off request. - DayPart *string `json:"day_part,omitempty"` - Notes *Notes `json:"notes,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` - // The policy type of the time off request - PolicyType *string `json:"policy_type,omitempty"` -} - -func (t TimeOffRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(t, "", false) -} - -func (t *TimeOffRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { - return err - } - return nil -} - -func (o *TimeOffRequest) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *TimeOffRequest) GetEmployeeID() *string { - if o == nil { - return nil - } - return o.EmployeeID -} - -func (o *TimeOffRequest) GetPolicyID() *string { - if o == nil { - return nil - } - return o.PolicyID -} - -func (o *TimeOffRequest) GetStatus() *TimeOffRequestStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *TimeOffRequest) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *TimeOffRequest) GetStartDate() *string { - if o == nil { - return nil - } - return o.StartDate -} - -func (o *TimeOffRequest) GetEndDate() *string { - if o == nil { - return nil - } - return o.EndDate -} - -func (o *TimeOffRequest) GetRequestDate() *string { - if o == nil { - return nil - } - return o.RequestDate -} - -func (o *TimeOffRequest) GetRequestType() *RequestType { - if o == nil { - return nil - } - return o.RequestType -} - -func (o *TimeOffRequest) GetApprovalDate() *string { - if o == nil { - return nil - } - return o.ApprovalDate -} - -func (o *TimeOffRequest) GetUnits() *Units { - if o == nil { - return nil - } - return o.Units -} - -func (o *TimeOffRequest) GetAmount() *float64 { - if o == nil { - return nil - } - return o.Amount -} - -func (o *TimeOffRequest) GetDayPart() *string { - if o == nil { - return nil - } - return o.DayPart -} - -func (o *TimeOffRequest) GetNotes() *Notes { - if o == nil { - return nil - } - return o.Notes -} - -func (o *TimeOffRequest) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *TimeOffRequest) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *TimeOffRequest) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *TimeOffRequest) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *TimeOffRequest) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *TimeOffRequest) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *TimeOffRequest) GetPolicyType() *string { - if o == nil { - return nil - } - return o.PolicyType -} - -type TimeOffRequestInput struct { - // ID of the employee - EmployeeID *string `json:"employee_id,omitempty"` - // ID of the policy - PolicyID *string `json:"policy_id,omitempty"` - // The status of the time off request. - Status *TimeOffRequestStatus `json:"status,omitempty"` - // Description of the time off request. - Description *string `json:"description,omitempty"` - // The start date of the time off request. - StartDate *string `json:"start_date,omitempty"` - // The end date of the time off request. - EndDate *string `json:"end_date,omitempty"` - // The date the request was made. - RequestDate *string `json:"request_date,omitempty"` - // The type of request - RequestType *RequestType `json:"request_type,omitempty"` - // The date the request was approved - ApprovalDate *string `json:"approval_date,omitempty"` - // The unit of time off requested. Possible values include: `hours`, `days`, or `other`. - Units *Units `json:"units,omitempty"` - // The amount of time off requested. - Amount *float64 `json:"amount,omitempty"` - // The day part of the time off request. - DayPart *string `json:"day_part,omitempty"` - Notes *Notes `json:"notes,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` - // The policy type of the time off request - PolicyType *string `json:"policy_type,omitempty"` -} - -func (o *TimeOffRequestInput) GetEmployeeID() *string { - if o == nil { - return nil - } - return o.EmployeeID -} - -func (o *TimeOffRequestInput) GetPolicyID() *string { - if o == nil { - return nil - } - return o.PolicyID -} - -func (o *TimeOffRequestInput) GetStatus() *TimeOffRequestStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *TimeOffRequestInput) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *TimeOffRequestInput) GetStartDate() *string { - if o == nil { - return nil - } - return o.StartDate -} - -func (o *TimeOffRequestInput) GetEndDate() *string { - if o == nil { - return nil - } - return o.EndDate -} - -func (o *TimeOffRequestInput) GetRequestDate() *string { - if o == nil { - return nil - } - return o.RequestDate -} - -func (o *TimeOffRequestInput) GetRequestType() *RequestType { - if o == nil { - return nil - } - return o.RequestType -} - -func (o *TimeOffRequestInput) GetApprovalDate() *string { - if o == nil { - return nil - } - return o.ApprovalDate -} - -func (o *TimeOffRequestInput) GetUnits() *Units { - if o == nil { - return nil - } - return o.Units -} - -func (o *TimeOffRequestInput) GetAmount() *float64 { - if o == nil { - return nil - } - return o.Amount -} - -func (o *TimeOffRequestInput) GetDayPart() *string { - if o == nil { - return nil - } - return o.DayPart -} - -func (o *TimeOffRequestInput) GetNotes() *Notes { - if o == nil { - return nil - } - return o.Notes -} - -func (o *TimeOffRequestInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *TimeOffRequestInput) GetPolicyType() *string { - if o == nil { - return nil - } - return o.PolicyType -} diff --git a/tests/mockserver/internal/sdk/models/components/timeoffrequestsfilter.go b/tests/mockserver/internal/sdk/models/components/timeoffrequestsfilter.go deleted file mode 100644 index 7b241c13..00000000 --- a/tests/mockserver/internal/sdk/models/components/timeoffrequestsfilter.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// TimeOffRequestsFilterTimeOffRequestStatus - Time off request status to filter on -type TimeOffRequestsFilterTimeOffRequestStatus string - -const ( - TimeOffRequestsFilterTimeOffRequestStatusRequested TimeOffRequestsFilterTimeOffRequestStatus = "requested" - TimeOffRequestsFilterTimeOffRequestStatusApproved TimeOffRequestsFilterTimeOffRequestStatus = "approved" - TimeOffRequestsFilterTimeOffRequestStatusDeclined TimeOffRequestsFilterTimeOffRequestStatus = "declined" - TimeOffRequestsFilterTimeOffRequestStatusCancelled TimeOffRequestsFilterTimeOffRequestStatus = "cancelled" - TimeOffRequestsFilterTimeOffRequestStatusDeleted TimeOffRequestsFilterTimeOffRequestStatus = "deleted" - TimeOffRequestsFilterTimeOffRequestStatusOther TimeOffRequestsFilterTimeOffRequestStatus = "other" -) - -func (e TimeOffRequestsFilterTimeOffRequestStatus) ToPointer() *TimeOffRequestsFilterTimeOffRequestStatus { - return &e -} -func (e *TimeOffRequestsFilterTimeOffRequestStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "requested": - fallthrough - case "approved": - fallthrough - case "declined": - fallthrough - case "cancelled": - fallthrough - case "deleted": - fallthrough - case "other": - *e = TimeOffRequestsFilterTimeOffRequestStatus(v) - return nil - default: - return fmt.Errorf("invalid value for TimeOffRequestsFilterTimeOffRequestStatus: %v", v) - } -} - -type TimeOffRequestsFilter struct { - // Start date - StartDate *string `queryParam:"name=start_date"` - // End date - EndDate *string `queryParam:"name=end_date"` - // Minimum date the time off request was last created or modified - UpdatedSince *string `queryParam:"name=updated_since"` - // Employee ID - EmployeeID *string `queryParam:"name=employee_id"` - // Time off request status to filter on - TimeOffRequestStatus *TimeOffRequestsFilterTimeOffRequestStatus `queryParam:"name=time_off_request_status"` - // Company ID - CompanyID *string `queryParam:"name=company_id"` -} - -func (o *TimeOffRequestsFilter) GetStartDate() *string { - if o == nil { - return nil - } - return o.StartDate -} - -func (o *TimeOffRequestsFilter) GetEndDate() *string { - if o == nil { - return nil - } - return o.EndDate -} - -func (o *TimeOffRequestsFilter) GetUpdatedSince() *string { - if o == nil { - return nil - } - return o.UpdatedSince -} - -func (o *TimeOffRequestsFilter) GetEmployeeID() *string { - if o == nil { - return nil - } - return o.EmployeeID -} - -func (o *TimeOffRequestsFilter) GetTimeOffRequestStatus() *TimeOffRequestsFilterTimeOffRequestStatus { - if o == nil { - return nil - } - return o.TimeOffRequestStatus -} - -func (o *TimeOffRequestsFilter) GetCompanyID() *string { - if o == nil { - return nil - } - return o.CompanyID -} diff --git a/tests/mockserver/internal/sdk/models/components/trackingcategory.go b/tests/mockserver/internal/sdk/models/components/trackingcategory.go deleted file mode 100644 index 8b8403da..00000000 --- a/tests/mockserver/internal/sdk/models/components/trackingcategory.go +++ /dev/null @@ -1,246 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// TrackingCategoryStatus - Based on the status some functionality is enabled or disabled. -type TrackingCategoryStatus string - -const ( - TrackingCategoryStatusActive TrackingCategoryStatus = "active" - TrackingCategoryStatusInactive TrackingCategoryStatus = "inactive" -) - -func (e TrackingCategoryStatus) ToPointer() *TrackingCategoryStatus { - return &e -} -func (e *TrackingCategoryStatus) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "active": - fallthrough - case "inactive": - *e = TrackingCategoryStatus(v) - return nil - default: - return fmt.Errorf("invalid value for TrackingCategoryStatus: %v", v) - } -} - -type TrackingCategorySubsidiary struct { - // The ID of the subsidiary. - ID *string `json:"id,omitempty"` -} - -func (o *TrackingCategorySubsidiary) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -type TrackingCategory struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // A unique identifier for an object. - ParentID *string `json:"parent_id,omitempty"` - // The name of the tracking category. - Name *string `json:"name,omitempty"` - // The code of the tracking category. - Code *string `json:"code,omitempty"` - // Based on the status some functionality is enabled or disabled. - Status *TrackingCategoryStatus `json:"status,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` - // The subsidiaries the account belongs to. - Subsidiaries []TrackingCategorySubsidiary `json:"subsidiaries,omitempty"` -} - -func (t TrackingCategory) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(t, "", false) -} - -func (t *TrackingCategory) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { - return err - } - return nil -} - -func (o *TrackingCategory) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *TrackingCategory) GetParentID() *string { - if o == nil { - return nil - } - return o.ParentID -} - -func (o *TrackingCategory) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *TrackingCategory) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *TrackingCategory) GetStatus() *TrackingCategoryStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *TrackingCategory) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *TrackingCategory) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *TrackingCategory) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *TrackingCategory) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *TrackingCategory) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *TrackingCategory) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *TrackingCategory) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *TrackingCategory) GetSubsidiaries() []TrackingCategorySubsidiary { - if o == nil { - return nil - } - return o.Subsidiaries -} - -type TrackingCategoryInput struct { - // A unique identifier for an object. - ParentID *string `json:"parent_id,omitempty"` - // The name of the tracking category. - Name *string `json:"name,omitempty"` - // The code of the tracking category. - Code *string `json:"code,omitempty"` - // Based on the status some functionality is enabled or disabled. - Status *TrackingCategoryStatus `json:"status,omitempty"` - // A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - RowVersion *string `json:"row_version,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` - // The subsidiaries the account belongs to. - Subsidiaries []TrackingCategorySubsidiary `json:"subsidiaries,omitempty"` -} - -func (o *TrackingCategoryInput) GetParentID() *string { - if o == nil { - return nil - } - return o.ParentID -} - -func (o *TrackingCategoryInput) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *TrackingCategoryInput) GetCode() *string { - if o == nil { - return nil - } - return o.Code -} - -func (o *TrackingCategoryInput) GetStatus() *TrackingCategoryStatus { - if o == nil { - return nil - } - return o.Status -} - -func (o *TrackingCategoryInput) GetRowVersion() *string { - if o == nil { - return nil - } - return o.RowVersion -} - -func (o *TrackingCategoryInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *TrackingCategoryInput) GetSubsidiaries() []TrackingCategorySubsidiary { - if o == nil { - return nil - } - return o.Subsidiaries -} diff --git a/tests/mockserver/internal/sdk/models/components/trackingitem.go b/tests/mockserver/internal/sdk/models/components/trackingitem.go deleted file mode 100644 index fc1d53cd..00000000 --- a/tests/mockserver/internal/sdk/models/components/trackingitem.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -// TrackingItem - Represents the tracking information associated with an ecommerce order. -type TrackingItem struct { - // The name or code of the carrier or shipping company that is handling the shipment. - Provider *string `json:"provider"` - // The tracking number associated with the shipment, which can be used to track the progress of the delivery. - Number *string `json:"number"` - // The URL of the carrier's tracking page, which can be used to view detailed information about the shipment's progress. - URL *string `json:"url,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` -} - -func (t TrackingItem) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(t, "", false) -} - -func (t *TrackingItem) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { - return err - } - return nil -} - -func (o *TrackingItem) GetProvider() *string { - if o == nil { - return nil - } - return o.Provider -} - -func (o *TrackingItem) GetNumber() *string { - if o == nil { - return nil - } - return o.Number -} - -func (o *TrackingItem) GetURL() *string { - if o == nil { - return nil - } - return o.URL -} - -func (o *TrackingItem) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} diff --git a/tests/mockserver/internal/sdk/models/components/unauthorizedresponseerror.go b/tests/mockserver/internal/sdk/models/components/unauthorizedresponseerror.go deleted file mode 100644 index 5648f2dd..00000000 --- a/tests/mockserver/internal/sdk/models/components/unauthorizedresponseerror.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "errors" - "fmt" - "mockserver/internal/sdk/utils" -) - -type UnauthorizedResponseDetailType string - -const ( - UnauthorizedResponseDetailTypeStr UnauthorizedResponseDetailType = "str" - UnauthorizedResponseDetailTypeMapOfAny UnauthorizedResponseDetailType = "mapOfAny" -) - -// UnauthorizedResponseDetail - Contains parameter or domain specific information related to the error and why it occurred. -type UnauthorizedResponseDetail struct { - Str *string `queryParam:"inline"` - MapOfAny map[string]any `queryParam:"inline"` - - Type UnauthorizedResponseDetailType -} - -func CreateUnauthorizedResponseDetailStr(str string) UnauthorizedResponseDetail { - typ := UnauthorizedResponseDetailTypeStr - - return UnauthorizedResponseDetail{ - Str: &str, - Type: typ, - } -} - -func CreateUnauthorizedResponseDetailMapOfAny(mapOfAny map[string]any) UnauthorizedResponseDetail { - typ := UnauthorizedResponseDetailTypeMapOfAny - - return UnauthorizedResponseDetail{ - MapOfAny: mapOfAny, - Type: typ, - } -} - -func (u *UnauthorizedResponseDetail) UnmarshalJSON(data []byte) error { - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = UnauthorizedResponseDetailTypeStr - return nil - } - - var mapOfAny map[string]any = map[string]any{} - if err := utils.UnmarshalJSON(data, &mapOfAny, "", true, true); err == nil { - u.MapOfAny = mapOfAny - u.Type = UnauthorizedResponseDetailTypeMapOfAny - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for UnauthorizedResponseDetail", string(data)) -} - -func (u UnauthorizedResponseDetail) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.MapOfAny != nil { - return utils.MarshalJSON(u.MapOfAny, "", true) - } - - return nil, errors.New("could not marshal union type UnauthorizedResponseDetail: all fields are null") -} diff --git a/tests/mockserver/internal/sdk/models/components/unexpectederrorresponse.go b/tests/mockserver/internal/sdk/models/components/unexpectederrorresponse.go deleted file mode 100644 index f2e291e5..00000000 --- a/tests/mockserver/internal/sdk/models/components/unexpectederrorresponse.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "errors" - "fmt" - "mockserver/internal/sdk/utils" -) - -type UnexpectedErrorResponseDetailType string - -const ( - UnexpectedErrorResponseDetailTypeStr UnexpectedErrorResponseDetailType = "str" - UnexpectedErrorResponseDetailTypeMapOfAny UnexpectedErrorResponseDetailType = "mapOfAny" -) - -// UnexpectedErrorResponseDetail - Contains parameter or domain specific information related to the error and why it occurred. -type UnexpectedErrorResponseDetail struct { - Str *string `queryParam:"inline"` - MapOfAny map[string]any `queryParam:"inline"` - - Type UnexpectedErrorResponseDetailType -} - -func CreateUnexpectedErrorResponseDetailStr(str string) UnexpectedErrorResponseDetail { - typ := UnexpectedErrorResponseDetailTypeStr - - return UnexpectedErrorResponseDetail{ - Str: &str, - Type: typ, - } -} - -func CreateUnexpectedErrorResponseDetailMapOfAny(mapOfAny map[string]any) UnexpectedErrorResponseDetail { - typ := UnexpectedErrorResponseDetailTypeMapOfAny - - return UnexpectedErrorResponseDetail{ - MapOfAny: mapOfAny, - Type: typ, - } -} - -func (u *UnexpectedErrorResponseDetail) UnmarshalJSON(data []byte) error { - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = UnexpectedErrorResponseDetailTypeStr - return nil - } - - var mapOfAny map[string]any = map[string]any{} - if err := utils.UnmarshalJSON(data, &mapOfAny, "", true, true); err == nil { - u.MapOfAny = mapOfAny - u.Type = UnexpectedErrorResponseDetailTypeMapOfAny - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for UnexpectedErrorResponseDetail", string(data)) -} - -func (u UnexpectedErrorResponseDetail) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.MapOfAny != nil { - return utils.MarshalJSON(u.MapOfAny, "", true) - } - - return nil, errors.New("could not marshal union type UnexpectedErrorResponseDetail: all fields are null") -} - -// UnexpectedErrorResponse - Unexpected error -type UnexpectedErrorResponse struct { - // HTTP status code - StatusCode *float64 `json:"status_code,omitempty"` - // Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) - Error *string `json:"error,omitempty"` - // The type of error returned - TypeName *string `json:"type_name,omitempty"` - // A human-readable message providing more details about the error. - Message *string `json:"message,omitempty"` - // Contains parameter or domain specific information related to the error and why it occurred. - Detail *UnexpectedErrorResponseDetail `json:"detail,omitempty"` - // Link to documentation of error type - Ref *string `json:"ref,omitempty"` -} - -func (o *UnexpectedErrorResponse) GetStatusCode() *float64 { - if o == nil { - return nil - } - return o.StatusCode -} - -func (o *UnexpectedErrorResponse) GetError() *string { - if o == nil { - return nil - } - return o.Error -} - -func (o *UnexpectedErrorResponse) GetTypeName() *string { - if o == nil { - return nil - } - return o.TypeName -} - -func (o *UnexpectedErrorResponse) GetMessage() *string { - if o == nil { - return nil - } - return o.Message -} - -func (o *UnexpectedErrorResponse) GetDetail() *UnexpectedErrorResponseDetail { - if o == nil { - return nil - } - return o.Detail -} - -func (o *UnexpectedErrorResponse) GetRef() *string { - if o == nil { - return nil - } - return o.Ref -} diff --git a/tests/mockserver/internal/sdk/models/components/unifiedapiid.go b/tests/mockserver/internal/sdk/models/components/unifiedapiid.go deleted file mode 100644 index 5ded547c..00000000 --- a/tests/mockserver/internal/sdk/models/components/unifiedapiid.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// UnifiedAPIID - Name of Apideck Unified API -type UnifiedAPIID string - -const ( - UnifiedAPIIDAccounting UnifiedAPIID = "accounting" - UnifiedAPIIDAts UnifiedAPIID = "ats" - UnifiedAPIIDCalendar UnifiedAPIID = "calendar" - UnifiedAPIIDCrm UnifiedAPIID = "crm" - UnifiedAPIIDCsp UnifiedAPIID = "csp" - UnifiedAPIIDCustomerSupport UnifiedAPIID = "customer-support" - UnifiedAPIIDEcommerce UnifiedAPIID = "ecommerce" - UnifiedAPIIDEmail UnifiedAPIID = "email" - UnifiedAPIIDEmailMarketing UnifiedAPIID = "email-marketing" - UnifiedAPIIDExpenseManagement UnifiedAPIID = "expense-management" - UnifiedAPIIDFileStorage UnifiedAPIID = "file-storage" - UnifiedAPIIDForm UnifiedAPIID = "form" - UnifiedAPIIDHris UnifiedAPIID = "hris" - UnifiedAPIIDLead UnifiedAPIID = "lead" - UnifiedAPIIDPayroll UnifiedAPIID = "payroll" - UnifiedAPIIDPos UnifiedAPIID = "pos" - UnifiedAPIIDProcurement UnifiedAPIID = "procurement" - UnifiedAPIIDProjectManagement UnifiedAPIID = "project-management" - UnifiedAPIIDScript UnifiedAPIID = "script" - UnifiedAPIIDSms UnifiedAPIID = "sms" - UnifiedAPIIDSpreadsheet UnifiedAPIID = "spreadsheet" - UnifiedAPIIDTeamMessaging UnifiedAPIID = "team-messaging" - UnifiedAPIIDIssueTracking UnifiedAPIID = "issue-tracking" - UnifiedAPIIDTimeRegistration UnifiedAPIID = "time-registration" - UnifiedAPIIDTransactionalEmail UnifiedAPIID = "transactional-email" - UnifiedAPIIDVault UnifiedAPIID = "vault" - UnifiedAPIIDDataWarehouse UnifiedAPIID = "data-warehouse" -) - -func (e UnifiedAPIID) ToPointer() *UnifiedAPIID { - return &e -} -func (e *UnifiedAPIID) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "accounting": - fallthrough - case "ats": - fallthrough - case "calendar": - fallthrough - case "crm": - fallthrough - case "csp": - fallthrough - case "customer-support": - fallthrough - case "ecommerce": - fallthrough - case "email": - fallthrough - case "email-marketing": - fallthrough - case "expense-management": - fallthrough - case "file-storage": - fallthrough - case "form": - fallthrough - case "hris": - fallthrough - case "lead": - fallthrough - case "payroll": - fallthrough - case "pos": - fallthrough - case "procurement": - fallthrough - case "project-management": - fallthrough - case "script": - fallthrough - case "sms": - fallthrough - case "spreadsheet": - fallthrough - case "team-messaging": - fallthrough - case "issue-tracking": - fallthrough - case "time-registration": - fallthrough - case "transactional-email": - fallthrough - case "vault": - fallthrough - case "data-warehouse": - *e = UnifiedAPIID(v) - return nil - default: - return fmt.Errorf("invalid value for UnifiedAPIID: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/unifiedfile.go b/tests/mockserver/internal/sdk/models/components/unifiedfile.go deleted file mode 100644 index 767acf04..00000000 --- a/tests/mockserver/internal/sdk/models/components/unifiedfile.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -// Permissions the current user has on this file. -type Permissions struct { - // Whether the current user can download this file. - Download *bool `json:"download,omitempty"` -} - -func (o *Permissions) GetDownload() *bool { - if o == nil { - return nil - } - return o.Download -} - -type UnifiedFile struct { - // A unique identifier for an object. - ID string `json:"id"` - // The third-party API ID of original entity - DownstreamID *string `json:"downstream_id,omitempty"` - // The name of the file - Name *string `json:"name"` - // Optional description of the file - Description *string `json:"description,omitempty"` - // The type of resource. Could be file, folder or url - Type *FileType `json:"type"` - // The full path of the file or folder (includes the file name) - Path *string `json:"path,omitempty"` - // The MIME type of the file. - MimeType *string `json:"mime_type,omitempty"` - // Whether the current user can download this file - Downloadable *bool `json:"downloadable,omitempty"` - // The size of the file in bytes - Size *int64 `json:"size,omitempty"` - Owner *Owner `json:"owner,omitempty"` - // The parent folders of the file, starting from the root - ParentFolders []LinkedFolder `json:"parent_folders,omitempty"` - // Whether the list of parent folders is complete. Some connectors only return the direct parent of a file - ParentFoldersComplete *bool `json:"parent_folders_complete,omitempty"` - // Permissions the current user has on this file. - Permissions *Permissions `json:"permissions,omitempty"` - // Whether the current file is exportable to other file formats. This property is relevant for proprietary file formats such as Google Docs or Dropbox Paper. - Exportable *bool `json:"exportable,omitempty"` - // The available file formats when exporting this file. - ExportFormats []string `json:"export_formats,omitempty"` - // When custom mappings are configured on the resource, the result is included here. - CustomMappings map[string]any `json:"custom_mappings,omitempty"` - // The user who last updated the object. - UpdatedBy *string `json:"updated_by,omitempty"` - // The user who created the object. - CreatedBy *string `json:"created_by,omitempty"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` -} - -func (u UnifiedFile) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(u, "", false) -} - -func (u *UnifiedFile) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &u, "", false, false); err != nil { - return err - } - return nil -} - -func (o *UnifiedFile) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *UnifiedFile) GetDownstreamID() *string { - if o == nil { - return nil - } - return o.DownstreamID -} - -func (o *UnifiedFile) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *UnifiedFile) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *UnifiedFile) GetType() *FileType { - if o == nil { - return nil - } - return o.Type -} - -func (o *UnifiedFile) GetPath() *string { - if o == nil { - return nil - } - return o.Path -} - -func (o *UnifiedFile) GetMimeType() *string { - if o == nil { - return nil - } - return o.MimeType -} - -func (o *UnifiedFile) GetDownloadable() *bool { - if o == nil { - return nil - } - return o.Downloadable -} - -func (o *UnifiedFile) GetSize() *int64 { - if o == nil { - return nil - } - return o.Size -} - -func (o *UnifiedFile) GetOwner() *Owner { - if o == nil { - return nil - } - return o.Owner -} - -func (o *UnifiedFile) GetParentFolders() []LinkedFolder { - if o == nil { - return nil - } - return o.ParentFolders -} - -func (o *UnifiedFile) GetParentFoldersComplete() *bool { - if o == nil { - return nil - } - return o.ParentFoldersComplete -} - -func (o *UnifiedFile) GetPermissions() *Permissions { - if o == nil { - return nil - } - return o.Permissions -} - -func (o *UnifiedFile) GetExportable() *bool { - if o == nil { - return nil - } - return o.Exportable -} - -func (o *UnifiedFile) GetExportFormats() []string { - if o == nil { - return nil - } - return o.ExportFormats -} - -func (o *UnifiedFile) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *UnifiedFile) GetUpdatedBy() *string { - if o == nil { - return nil - } - return o.UpdatedBy -} - -func (o *UnifiedFile) GetCreatedBy() *string { - if o == nil { - return nil - } - return o.CreatedBy -} - -func (o *UnifiedFile) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *UnifiedFile) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} diff --git a/tests/mockserver/internal/sdk/models/components/unifiedid.go b/tests/mockserver/internal/sdk/models/components/unifiedid.go deleted file mode 100644 index 0c675171..00000000 --- a/tests/mockserver/internal/sdk/models/components/unifiedid.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UnifiedID - A object containing a unique identifier for the resource that was created, updated, or deleted. -type UnifiedID struct { - // The unique identifier of the resource - ID string `json:"id"` -} - -func (o *UnifiedID) GetID() string { - if o == nil { - return "" - } - return o.ID -} diff --git a/tests/mockserver/internal/sdk/models/components/unprocessableresponseerror.go b/tests/mockserver/internal/sdk/models/components/unprocessableresponseerror.go deleted file mode 100644 index 6109108d..00000000 --- a/tests/mockserver/internal/sdk/models/components/unprocessableresponseerror.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "errors" - "fmt" - "mockserver/internal/sdk/utils" -) - -type UnprocessableResponseDetailType string - -const ( - UnprocessableResponseDetailTypeStr UnprocessableResponseDetailType = "str" - UnprocessableResponseDetailTypeMapOfAny UnprocessableResponseDetailType = "mapOfAny" -) - -// UnprocessableResponseDetail - Contains parameter or domain specific information related to the error and why it occurred. -type UnprocessableResponseDetail struct { - Str *string `queryParam:"inline"` - MapOfAny map[string]any `queryParam:"inline"` - - Type UnprocessableResponseDetailType -} - -func CreateUnprocessableResponseDetailStr(str string) UnprocessableResponseDetail { - typ := UnprocessableResponseDetailTypeStr - - return UnprocessableResponseDetail{ - Str: &str, - Type: typ, - } -} - -func CreateUnprocessableResponseDetailMapOfAny(mapOfAny map[string]any) UnprocessableResponseDetail { - typ := UnprocessableResponseDetailTypeMapOfAny - - return UnprocessableResponseDetail{ - MapOfAny: mapOfAny, - Type: typ, - } -} - -func (u *UnprocessableResponseDetail) UnmarshalJSON(data []byte) error { - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = UnprocessableResponseDetailTypeStr - return nil - } - - var mapOfAny map[string]any = map[string]any{} - if err := utils.UnmarshalJSON(data, &mapOfAny, "", true, true); err == nil { - u.MapOfAny = mapOfAny - u.Type = UnprocessableResponseDetailTypeMapOfAny - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for UnprocessableResponseDetail", string(data)) -} - -func (u UnprocessableResponseDetail) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.MapOfAny != nil { - return utils.MarshalJSON(u.MapOfAny, "", true) - } - - return nil, errors.New("could not marshal union type UnprocessableResponseDetail: all fields are null") -} diff --git a/tests/mockserver/internal/sdk/models/components/updateaccountingdepartmentresponse.go b/tests/mockserver/internal/sdk/models/components/updateaccountingdepartmentresponse.go deleted file mode 100644 index 11e5ce23..00000000 --- a/tests/mockserver/internal/sdk/models/components/updateaccountingdepartmentresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateAccountingDepartmentResponse - Department -type UpdateAccountingDepartmentResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateAccountingDepartmentResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateAccountingDepartmentResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateAccountingDepartmentResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateAccountingDepartmentResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateAccountingDepartmentResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateAccountingDepartmentResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateAccountingDepartmentResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updateaccountinglocationresponse.go b/tests/mockserver/internal/sdk/models/components/updateaccountinglocationresponse.go deleted file mode 100644 index 6f97cb4b..00000000 --- a/tests/mockserver/internal/sdk/models/components/updateaccountinglocationresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateAccountingLocationResponse - Location -type UpdateAccountingLocationResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateAccountingLocationResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateAccountingLocationResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateAccountingLocationResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateAccountingLocationResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateAccountingLocationResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateAccountingLocationResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateAccountingLocationResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updateactivityresponse.go b/tests/mockserver/internal/sdk/models/components/updateactivityresponse.go deleted file mode 100644 index 5914d6ce..00000000 --- a/tests/mockserver/internal/sdk/models/components/updateactivityresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateActivityResponse - Activity updated -type UpdateActivityResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateActivityResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateActivityResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateActivityResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateActivityResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateActivityResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateActivityResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateActivityResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updateapplicantresponse.go b/tests/mockserver/internal/sdk/models/components/updateapplicantresponse.go deleted file mode 100644 index ed51762d..00000000 --- a/tests/mockserver/internal/sdk/models/components/updateapplicantresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateApplicantResponse - Applicants -type UpdateApplicantResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateApplicantResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateApplicantResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateApplicantResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateApplicantResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateApplicantResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateApplicantResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateApplicantResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updateapplicationresponse.go b/tests/mockserver/internal/sdk/models/components/updateapplicationresponse.go deleted file mode 100644 index 3220d5d2..00000000 --- a/tests/mockserver/internal/sdk/models/components/updateapplicationresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateApplicationResponse - Applications -type UpdateApplicationResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateApplicationResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateApplicationResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateApplicationResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateApplicationResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateApplicationResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateApplicationResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateApplicationResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatebankfeedaccountresponse.go b/tests/mockserver/internal/sdk/models/components/updatebankfeedaccountresponse.go deleted file mode 100644 index aed5ff2e..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatebankfeedaccountresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateBankFeedAccountResponse - Bank Feed Accounts -type UpdateBankFeedAccountResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateBankFeedAccountResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateBankFeedAccountResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateBankFeedAccountResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateBankFeedAccountResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateBankFeedAccountResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateBankFeedAccountResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateBankFeedAccountResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatebankfeedstatementresponse.go b/tests/mockserver/internal/sdk/models/components/updatebankfeedstatementresponse.go deleted file mode 100644 index e4845b5d..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatebankfeedstatementresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateBankFeedStatementResponse - Bank Feed Statements -type UpdateBankFeedStatementResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateBankFeedStatementResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateBankFeedStatementResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateBankFeedStatementResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateBankFeedStatementResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateBankFeedStatementResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateBankFeedStatementResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateBankFeedStatementResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatebillpaymentresponse.go b/tests/mockserver/internal/sdk/models/components/updatebillpaymentresponse.go deleted file mode 100644 index 3a9cd301..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatebillpaymentresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateBillPaymentResponse - Bill Payment updated -type UpdateBillPaymentResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateBillPaymentResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateBillPaymentResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateBillPaymentResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateBillPaymentResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateBillPaymentResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateBillPaymentResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateBillPaymentResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatebillresponse.go b/tests/mockserver/internal/sdk/models/components/updatebillresponse.go deleted file mode 100644 index fa6a0522..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatebillresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateBillResponse - Bill Updated -type UpdateBillResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateBillResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateBillResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateBillResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateBillResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateBillResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateBillResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateBillResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatecommentresponse.go b/tests/mockserver/internal/sdk/models/components/updatecommentresponse.go deleted file mode 100644 index 019a84e7..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatecommentresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateCommentResponse - Update a Comment -type UpdateCommentResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateCommentResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateCommentResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateCommentResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateCommentResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateCommentResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateCommentResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateCommentResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatecompanyresponse.go b/tests/mockserver/internal/sdk/models/components/updatecompanyresponse.go deleted file mode 100644 index 31122748..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatecompanyresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateCompanyResponse - Company updated -type UpdateCompanyResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateCompanyResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateCompanyResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateCompanyResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateCompanyResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateCompanyResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateCompanyResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateCompanyResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updateconnectionresponse.go b/tests/mockserver/internal/sdk/models/components/updateconnectionresponse.go deleted file mode 100644 index 38f6e695..00000000 --- a/tests/mockserver/internal/sdk/models/components/updateconnectionresponse.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateConnectionResponse - Connection updated -type UpdateConnectionResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data Connection `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateConnectionResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateConnectionResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateConnectionResponse) GetData() Connection { - if o == nil { - return Connection{} - } - return o.Data -} - -func (o *UpdateConnectionResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updateconsumerrequest.go b/tests/mockserver/internal/sdk/models/components/updateconsumerrequest.go deleted file mode 100644 index 7920ce1c..00000000 --- a/tests/mockserver/internal/sdk/models/components/updateconsumerrequest.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type UpdateConsumerRequest struct { - // The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. - Metadata *ConsumerMetadata `json:"metadata,omitempty"` -} - -func (o *UpdateConsumerRequest) GetMetadata() *ConsumerMetadata { - if o == nil { - return nil - } - return o.Metadata -} diff --git a/tests/mockserver/internal/sdk/models/components/updateconsumerresponse.go b/tests/mockserver/internal/sdk/models/components/updateconsumerresponse.go deleted file mode 100644 index 81553161..00000000 --- a/tests/mockserver/internal/sdk/models/components/updateconsumerresponse.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateConsumerResponse - Consumer updated -type UpdateConsumerResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data Consumer `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateConsumerResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateConsumerResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateConsumerResponse) GetData() Consumer { - if o == nil { - return Consumer{} - } - return o.Data -} - -func (o *UpdateConsumerResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatecontactresponse.go b/tests/mockserver/internal/sdk/models/components/updatecontactresponse.go deleted file mode 100644 index 7a162112..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatecontactresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateContactResponse - Contact updated -type UpdateContactResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateContactResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateContactResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateContactResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateContactResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateContactResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateContactResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateContactResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatecreditnoteresponse.go b/tests/mockserver/internal/sdk/models/components/updatecreditnoteresponse.go deleted file mode 100644 index 7fd68deb..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatecreditnoteresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateCreditNoteResponse - Credit Note updated -type UpdateCreditNoteResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateCreditNoteResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateCreditNoteResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateCreditNoteResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateCreditNoteResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateCreditNoteResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateCreditNoteResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateCreditNoteResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatecustomerresponse.go b/tests/mockserver/internal/sdk/models/components/updatecustomerresponse.go deleted file mode 100644 index 2c0206f6..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatecustomerresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateCustomerResponse - Customers -type UpdateCustomerResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateCustomerResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateCustomerResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateCustomerResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateCustomerResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateCustomerResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateCustomerResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateCustomerResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatecustomobjectresponse.go b/tests/mockserver/internal/sdk/models/components/updatecustomobjectresponse.go deleted file mode 100644 index 59573d78..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatecustomobjectresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateCustomObjectResponse - Custom object updated -type UpdateCustomObjectResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateCustomObjectResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateCustomObjectResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateCustomObjectResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateCustomObjectResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateCustomObjectResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateCustomObjectResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateCustomObjectResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatecustomobjectschemaresponse.go b/tests/mockserver/internal/sdk/models/components/updatecustomobjectschemaresponse.go deleted file mode 100644 index 31574cd6..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatecustomobjectschemaresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateCustomObjectSchemaResponse - Custom object schema updated -type UpdateCustomObjectSchemaResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateCustomObjectSchemaResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateCustomObjectSchemaResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateCustomObjectSchemaResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateCustomObjectSchemaResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateCustomObjectSchemaResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateCustomObjectSchemaResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateCustomObjectSchemaResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatedepartmentresponse.go b/tests/mockserver/internal/sdk/models/components/updatedepartmentresponse.go deleted file mode 100644 index 7eba9570..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatedepartmentresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateDepartmentResponse - Departments -type UpdateDepartmentResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateDepartmentResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateDepartmentResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateDepartmentResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateDepartmentResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateDepartmentResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateDepartmentResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateDepartmentResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatedrivegroupresponse.go b/tests/mockserver/internal/sdk/models/components/updatedrivegroupresponse.go deleted file mode 100644 index 183cbdf2..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatedrivegroupresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateDriveGroupResponse - DriveGroups -type UpdateDriveGroupResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateDriveGroupResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateDriveGroupResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateDriveGroupResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateDriveGroupResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateDriveGroupResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateDriveGroupResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateDriveGroupResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatedriveresponse.go b/tests/mockserver/internal/sdk/models/components/updatedriveresponse.go deleted file mode 100644 index d0ff5ab2..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatedriveresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateDriveResponse - Drives -type UpdateDriveResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateDriveResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateDriveResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateDriveResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateDriveResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateDriveResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateDriveResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateDriveResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updateemployeeresponse.go b/tests/mockserver/internal/sdk/models/components/updateemployeeresponse.go deleted file mode 100644 index 395898ab..00000000 --- a/tests/mockserver/internal/sdk/models/components/updateemployeeresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateEmployeeResponse - Employees -type UpdateEmployeeResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateEmployeeResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateEmployeeResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateEmployeeResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateEmployeeResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateEmployeeResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateEmployeeResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateEmployeeResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updateexpenseresponse.go b/tests/mockserver/internal/sdk/models/components/updateexpenseresponse.go deleted file mode 100644 index fbc528a2..00000000 --- a/tests/mockserver/internal/sdk/models/components/updateexpenseresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateExpenseResponse - Expenses -type UpdateExpenseResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateExpenseResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateExpenseResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateExpenseResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateExpenseResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateExpenseResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateExpenseResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateExpenseResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatefilerequest.go b/tests/mockserver/internal/sdk/models/components/updatefilerequest.go deleted file mode 100644 index 72bc10a8..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatefilerequest.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type UpdateFileRequest struct { - // The name of the file. - Name *string `json:"name,omitempty"` - // Optional description of the file. - Description *string `json:"description,omitempty"` - // The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. - ParentFolderID *string `json:"parent_folder_id,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *UpdateFileRequest) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *UpdateFileRequest) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *UpdateFileRequest) GetParentFolderID() *string { - if o == nil { - return nil - } - return o.ParentFolderID -} - -func (o *UpdateFileRequest) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/updatefileresponse.go b/tests/mockserver/internal/sdk/models/components/updatefileresponse.go deleted file mode 100644 index dd554282..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatefileresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateFileResponse - Files -type UpdateFileResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateFileResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateFileResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateFileResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateFileResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateFileResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateFileResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateFileResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatefolderrequest.go b/tests/mockserver/internal/sdk/models/components/updatefolderrequest.go deleted file mode 100644 index 0c46de0a..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatefolderrequest.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type UpdateFolderRequest struct { - // The name of the folder. - Name *string `json:"name,omitempty"` - // Optional description of the folder. - Description *string `json:"description,omitempty"` - // The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. - ParentFolderID *string `json:"parent_folder_id,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *UpdateFolderRequest) GetName() *string { - if o == nil { - return nil - } - return o.Name -} - -func (o *UpdateFolderRequest) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *UpdateFolderRequest) GetParentFolderID() *string { - if o == nil { - return nil - } - return o.ParentFolderID -} - -func (o *UpdateFolderRequest) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/updatefolderresponse.go b/tests/mockserver/internal/sdk/models/components/updatefolderresponse.go deleted file mode 100644 index 6cf4cdbc..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatefolderresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateFolderResponse - Folders -type UpdateFolderResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateFolderResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateFolderResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateFolderResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateFolderResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateFolderResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateFolderResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateFolderResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatehriscompanyresponse.go b/tests/mockserver/internal/sdk/models/components/updatehriscompanyresponse.go deleted file mode 100644 index affd805c..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatehriscompanyresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateHrisCompanyResponse - Companies -type UpdateHrisCompanyResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateHrisCompanyResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateHrisCompanyResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateHrisCompanyResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateHrisCompanyResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateHrisCompanyResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateHrisCompanyResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateHrisCompanyResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updateinvoiceitemsresponse.go b/tests/mockserver/internal/sdk/models/components/updateinvoiceitemsresponse.go deleted file mode 100644 index d5acf946..00000000 --- a/tests/mockserver/internal/sdk/models/components/updateinvoiceitemsresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateInvoiceItemsResponse - InvoiceItems -type UpdateInvoiceItemsResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateInvoiceItemsResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateInvoiceItemsResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateInvoiceItemsResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateInvoiceItemsResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateInvoiceItemsResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateInvoiceItemsResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateInvoiceItemsResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updateinvoiceresponse.go b/tests/mockserver/internal/sdk/models/components/updateinvoiceresponse.go deleted file mode 100644 index efe95cf5..00000000 --- a/tests/mockserver/internal/sdk/models/components/updateinvoiceresponse.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateInvoiceResponse - Invoice updated -type UpdateInvoiceResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - Data InvoiceResponse `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateInvoiceResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateInvoiceResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateInvoiceResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateInvoiceResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateInvoiceResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateInvoiceResponse) GetData() InvoiceResponse { - if o == nil { - return InvoiceResponse{} - } - return o.Data -} - -func (o *UpdateInvoiceResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatejournalentryresponse.go b/tests/mockserver/internal/sdk/models/components/updatejournalentryresponse.go deleted file mode 100644 index 1daeebd5..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatejournalentryresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateJournalEntryResponse - JournalEntries -type UpdateJournalEntryResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateJournalEntryResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateJournalEntryResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateJournalEntryResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateJournalEntryResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateJournalEntryResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateJournalEntryResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateJournalEntryResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updateleadresponse.go b/tests/mockserver/internal/sdk/models/components/updateleadresponse.go deleted file mode 100644 index 3e271515..00000000 --- a/tests/mockserver/internal/sdk/models/components/updateleadresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateLeadResponse - Lead updated -type UpdateLeadResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateLeadResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateLeadResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateLeadResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateLeadResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateLeadResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateLeadResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateLeadResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updateledgeraccountresponse.go b/tests/mockserver/internal/sdk/models/components/updateledgeraccountresponse.go deleted file mode 100644 index ab02aa1f..00000000 --- a/tests/mockserver/internal/sdk/models/components/updateledgeraccountresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateLedgerAccountResponse - LedgerAccount updated -type UpdateLedgerAccountResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateLedgerAccountResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateLedgerAccountResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateLedgerAccountResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateLedgerAccountResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateLedgerAccountResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateLedgerAccountResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateLedgerAccountResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatemessageresponse.go b/tests/mockserver/internal/sdk/models/components/updatemessageresponse.go deleted file mode 100644 index 96a7ac37..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatemessageresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateMessageResponse - Messages -type UpdateMessageResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateMessageResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateMessageResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateMessageResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateMessageResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateMessageResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateMessageResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateMessageResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatenoteresponse.go b/tests/mockserver/internal/sdk/models/components/updatenoteresponse.go deleted file mode 100644 index 774927dc..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatenoteresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateNoteResponse - Note updated -type UpdateNoteResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateNoteResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateNoteResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateNoteResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateNoteResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateNoteResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateNoteResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateNoteResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updateopportunityresponse.go b/tests/mockserver/internal/sdk/models/components/updateopportunityresponse.go deleted file mode 100644 index 6bd48aee..00000000 --- a/tests/mockserver/internal/sdk/models/components/updateopportunityresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateOpportunityResponse - Opportunity updated -type UpdateOpportunityResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateOpportunityResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateOpportunityResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateOpportunityResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateOpportunityResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateOpportunityResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateOpportunityResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateOpportunityResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatepaymentresponse.go b/tests/mockserver/internal/sdk/models/components/updatepaymentresponse.go deleted file mode 100644 index a0cf0c76..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatepaymentresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdatePaymentResponse - Payment Updated -type UpdatePaymentResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdatePaymentResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdatePaymentResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdatePaymentResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdatePaymentResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdatePaymentResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdatePaymentResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdatePaymentResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatepipelineresponse.go b/tests/mockserver/internal/sdk/models/components/updatepipelineresponse.go deleted file mode 100644 index 0728567f..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatepipelineresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdatePipelineResponse - Pipeline updated -type UpdatePipelineResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdatePipelineResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdatePipelineResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdatePipelineResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdatePipelineResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdatePipelineResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdatePipelineResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdatePipelineResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatepurchaseorderresponse.go b/tests/mockserver/internal/sdk/models/components/updatepurchaseorderresponse.go deleted file mode 100644 index 11b87b26..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatepurchaseorderresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdatePurchaseOrderResponse - PurchaseOrders -type UpdatePurchaseOrderResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdatePurchaseOrderResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdatePurchaseOrderResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdatePurchaseOrderResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdatePurchaseOrderResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdatePurchaseOrderResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdatePurchaseOrderResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdatePurchaseOrderResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatesharedlinkresponse.go b/tests/mockserver/internal/sdk/models/components/updatesharedlinkresponse.go deleted file mode 100644 index 34e4c680..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatesharedlinkresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateSharedLinkResponse - Shared Links -type UpdateSharedLinkResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateSharedLinkResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateSharedLinkResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateSharedLinkResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateSharedLinkResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateSharedLinkResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateSharedLinkResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateSharedLinkResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatesubsidiaryresponse.go b/tests/mockserver/internal/sdk/models/components/updatesubsidiaryresponse.go deleted file mode 100644 index 0b48c3cc..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatesubsidiaryresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateSubsidiaryResponse - Subsidiaries -type UpdateSubsidiaryResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateSubsidiaryResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateSubsidiaryResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateSubsidiaryResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateSubsidiaryResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateSubsidiaryResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateSubsidiaryResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateSubsidiaryResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatesupplierresponse.go b/tests/mockserver/internal/sdk/models/components/updatesupplierresponse.go deleted file mode 100644 index 07dd55ea..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatesupplierresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateSupplierResponse - Supplier updated -type UpdateSupplierResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateSupplierResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateSupplierResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateSupplierResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateSupplierResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateSupplierResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateSupplierResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateSupplierResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatetaxrateresponse.go b/tests/mockserver/internal/sdk/models/components/updatetaxrateresponse.go deleted file mode 100644 index 2778589c..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatetaxrateresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateTaxRateResponse - TaxRate updated -type UpdateTaxRateResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateTaxRateResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateTaxRateResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateTaxRateResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateTaxRateResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateTaxRateResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateTaxRateResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateTaxRateResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updateticketresponse.go b/tests/mockserver/internal/sdk/models/components/updateticketresponse.go deleted file mode 100644 index b003c092..00000000 --- a/tests/mockserver/internal/sdk/models/components/updateticketresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateTicketResponse - Update a Ticket -type UpdateTicketResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateTicketResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateTicketResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateTicketResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateTicketResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateTicketResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateTicketResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateTicketResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatetimeoffrequestresponse.go b/tests/mockserver/internal/sdk/models/components/updatetimeoffrequestresponse.go deleted file mode 100644 index 1df3ef8a..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatetimeoffrequestresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateTimeOffRequestResponse - TimeOffRequests -type UpdateTimeOffRequestResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateTimeOffRequestResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateTimeOffRequestResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateTimeOffRequestResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateTimeOffRequestResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateTimeOffRequestResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateTimeOffRequestResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateTimeOffRequestResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatetrackingcategoryresponse.go b/tests/mockserver/internal/sdk/models/components/updatetrackingcategoryresponse.go deleted file mode 100644 index 55ffb158..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatetrackingcategoryresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateTrackingCategoryResponse - Tracking category updated -type UpdateTrackingCategoryResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateTrackingCategoryResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateTrackingCategoryResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateTrackingCategoryResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateTrackingCategoryResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateTrackingCategoryResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateTrackingCategoryResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateTrackingCategoryResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updateuploadsessionresponse.go b/tests/mockserver/internal/sdk/models/components/updateuploadsessionresponse.go deleted file mode 100644 index 83f179cd..00000000 --- a/tests/mockserver/internal/sdk/models/components/updateuploadsessionresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateUploadSessionResponse - UploadSessions -type UpdateUploadSessionResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateUploadSessionResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateUploadSessionResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateUploadSessionResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateUploadSessionResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateUploadSessionResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateUploadSessionResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateUploadSessionResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updateuserresponse.go b/tests/mockserver/internal/sdk/models/components/updateuserresponse.go deleted file mode 100644 index 6ef325da..00000000 --- a/tests/mockserver/internal/sdk/models/components/updateuserresponse.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateUserResponse - User updated -type UpdateUserResponse 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"` - // Unified API resource name - Resource string `json:"resource"` - // Operation performed - Operation string `json:"operation"` - // A object containing a unique identifier for the resource that was created, updated, or deleted. - Data UnifiedID `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateUserResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateUserResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateUserResponse) GetService() string { - if o == nil { - return "" - } - return o.Service -} - -func (o *UpdateUserResponse) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *UpdateUserResponse) GetOperation() string { - if o == nil { - return "" - } - return o.Operation -} - -func (o *UpdateUserResponse) GetData() UnifiedID { - if o == nil { - return UnifiedID{} - } - return o.Data -} - -func (o *UpdateUserResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/updatewebhookrequest.go b/tests/mockserver/internal/sdk/models/components/updatewebhookrequest.go deleted file mode 100644 index 0014f107..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatewebhookrequest.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type UpdateWebhookRequest struct { - // A description of the object. - Description *string `json:"description,omitempty"` - // The status of the webhook. - Status *Status `json:"status,omitempty"` - // The delivery url of the webhook endpoint. - DeliveryURL *string `json:"delivery_url,omitempty"` - // The list of subscribed events for this webhook. [`*`] indicates that all events are enabled. - Events []WebhookEventType `json:"events,omitempty"` -} - -func (o *UpdateWebhookRequest) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *UpdateWebhookRequest) GetStatus() *Status { - if o == nil { - return nil - } - return o.Status -} - -func (o *UpdateWebhookRequest) GetDeliveryURL() *string { - if o == nil { - return nil - } - return o.DeliveryURL -} - -func (o *UpdateWebhookRequest) GetEvents() []WebhookEventType { - if o == nil { - return nil - } - return o.Events -} diff --git a/tests/mockserver/internal/sdk/models/components/updatewebhookresponse.go b/tests/mockserver/internal/sdk/models/components/updatewebhookresponse.go deleted file mode 100644 index 0ad2b80c..00000000 --- a/tests/mockserver/internal/sdk/models/components/updatewebhookresponse.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// UpdateWebhookResponse - Webhooks -type UpdateWebhookResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data Webhook `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *UpdateWebhookResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *UpdateWebhookResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *UpdateWebhookResponse) GetData() Webhook { - if o == nil { - return Webhook{} - } - return o.Data -} - -func (o *UpdateWebhookResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/uploadsession.go b/tests/mockserver/internal/sdk/models/components/uploadsession.go deleted file mode 100644 index 7a7c809e..00000000 --- a/tests/mockserver/internal/sdk/models/components/uploadsession.go +++ /dev/null @@ -1,75 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "mockserver/internal/sdk/utils" - "time" -) - -type UploadSession struct { - // A unique identifier for an object. - ID *string `json:"id,omitempty"` - // Indicates if the upload session was completed successfully. - Success *bool `json:"success,omitempty"` - // Size in bytes of each part of the file that you will upload. Uploaded parts need to be this size for the upload to be successful. - PartSize *float64 `json:"part_size,omitempty"` - // Indicates if parts of the file can uploaded in parallel. - ParallelUploadSupported *bool `json:"parallel_upload_supported,omitempty"` - // The range of bytes that was successfully uploaded. - UploadedByteRange *string `json:"uploaded_byte_range,omitempty"` - ExpiresAt *time.Time `json:"expires_at,omitempty"` -} - -func (u UploadSession) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(u, "", false) -} - -func (u *UploadSession) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &u, "", false, false); err != nil { - return err - } - return nil -} - -func (o *UploadSession) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *UploadSession) GetSuccess() *bool { - if o == nil { - return nil - } - return o.Success -} - -func (o *UploadSession) GetPartSize() *float64 { - if o == nil { - return nil - } - return o.PartSize -} - -func (o *UploadSession) GetParallelUploadSupported() *bool { - if o == nil { - return nil - } - return o.ParallelUploadSupported -} - -func (o *UploadSession) GetUploadedByteRange() *string { - if o == nil { - return nil - } - return o.UploadedByteRange -} - -func (o *UploadSession) GetExpiresAt() *time.Time { - if o == nil { - return nil - } - return o.ExpiresAt -} diff --git a/tests/mockserver/internal/sdk/models/components/userinput.go b/tests/mockserver/internal/sdk/models/components/userinput.go deleted file mode 100644 index 7e140b10..00000000 --- a/tests/mockserver/internal/sdk/models/components/userinput.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type UserInput struct { - // The parent user id - ParentID *string `json:"parent_id,omitempty"` - // The username of the user - Username *string `json:"username,omitempty"` - // The first name of the person. - FirstName *string `json:"first_name,omitempty"` - // The last name of the person. - LastName *string `json:"last_name,omitempty"` - // The job title of the person. - Title *string `json:"title,omitempty"` - // The division the person is currently in. Usually a collection of departments or teams or regions. - Division *string `json:"division,omitempty"` - // The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. - // - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - Department *string `json:"department,omitempty"` - // The name of the company. - CompanyName *string `json:"company_name,omitempty"` - // An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. - EmployeeNumber *string `json:"employee_number,omitempty"` - // A description of the object. - Description *string `json:"description,omitempty"` - // The URL of the user's avatar - Image *string `json:"image,omitempty"` - // language code according to ISO 639-1. For the United States - EN - Language *string `json:"language,omitempty"` - // The status of the user - Status *string `json:"status,omitempty"` - // The password of the user - Password *string `json:"password,omitempty"` - Addresses []Address `json:"addresses,omitempty"` - PhoneNumbers []PhoneNumber `json:"phone_numbers,omitempty"` - Emails []Email `json:"emails"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *UserInput) GetParentID() *string { - if o == nil { - return nil - } - return o.ParentID -} - -func (o *UserInput) GetUsername() *string { - if o == nil { - return nil - } - return o.Username -} - -func (o *UserInput) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *UserInput) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *UserInput) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *UserInput) GetDivision() *string { - if o == nil { - return nil - } - return o.Division -} - -func (o *UserInput) GetDepartment() *string { - if o == nil { - return nil - } - return o.Department -} - -func (o *UserInput) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *UserInput) GetEmployeeNumber() *string { - if o == nil { - return nil - } - return o.EmployeeNumber -} - -func (o *UserInput) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *UserInput) GetImage() *string { - if o == nil { - return nil - } - return o.Image -} - -func (o *UserInput) GetLanguage() *string { - if o == nil { - return nil - } - return o.Language -} - -func (o *UserInput) GetStatus() *string { - if o == nil { - return nil - } - return o.Status -} - -func (o *UserInput) GetPassword() *string { - if o == nil { - return nil - } - return o.Password -} - -func (o *UserInput) GetAddresses() []Address { - if o == nil { - return nil - } - return o.Addresses -} - -func (o *UserInput) GetPhoneNumbers() []PhoneNumber { - if o == nil { - return nil - } - return o.PhoneNumbers -} - -func (o *UserInput) GetEmails() []Email { - if o == nil { - return []Email{} - } - return o.Emails -} - -func (o *UserInput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/useroutput.go b/tests/mockserver/internal/sdk/models/components/useroutput.go deleted file mode 100644 index 77b9ea9b..00000000 --- a/tests/mockserver/internal/sdk/models/components/useroutput.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type UserOutput struct { - // The unique identifier for the user - ID *string `json:"id,omitempty"` - // The parent user id - ParentID *string `json:"parent_id,omitempty"` - // The username of the user - Username *string `json:"username,omitempty"` - // The first name of the person. - FirstName *string `json:"first_name,omitempty"` - // The last name of the person. - LastName *string `json:"last_name,omitempty"` - // The job title of the person. - Title *string `json:"title,omitempty"` - // The division the person is currently in. Usually a collection of departments or teams or regions. - Division *string `json:"division,omitempty"` - // The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. - // - // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. - Department *string `json:"department,omitempty"` - // The name of the company. - CompanyName *string `json:"company_name,omitempty"` - // An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. - EmployeeNumber *string `json:"employee_number,omitempty"` - // A description of the object. - Description *string `json:"description,omitempty"` - // The URL of the user's avatar - Image *string `json:"image,omitempty"` - // language code according to ISO 639-1. For the United States - EN - Language *string `json:"language,omitempty"` - // The status of the user - Status *string `json:"status,omitempty"` - Addresses []Address `json:"addresses,omitempty"` - PhoneNumbers []PhoneNumber `json:"phone_numbers,omitempty"` - Emails []Email `json:"emails"` - // 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 user was last updated. - UpdatedAt *string `json:"updated_at,omitempty"` - // The date and time when the user was created. - CreatedAt *string `json:"created_at,omitempty"` - // The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - PassThrough []PassThroughBody `json:"pass_through,omitempty"` -} - -func (o *UserOutput) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *UserOutput) GetParentID() *string { - if o == nil { - return nil - } - return o.ParentID -} - -func (o *UserOutput) GetUsername() *string { - if o == nil { - return nil - } - return o.Username -} - -func (o *UserOutput) GetFirstName() *string { - if o == nil { - return nil - } - return o.FirstName -} - -func (o *UserOutput) GetLastName() *string { - if o == nil { - return nil - } - return o.LastName -} - -func (o *UserOutput) GetTitle() *string { - if o == nil { - return nil - } - return o.Title -} - -func (o *UserOutput) GetDivision() *string { - if o == nil { - return nil - } - return o.Division -} - -func (o *UserOutput) GetDepartment() *string { - if o == nil { - return nil - } - return o.Department -} - -func (o *UserOutput) GetCompanyName() *string { - if o == nil { - return nil - } - return o.CompanyName -} - -func (o *UserOutput) GetEmployeeNumber() *string { - if o == nil { - return nil - } - return o.EmployeeNumber -} - -func (o *UserOutput) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *UserOutput) GetImage() *string { - if o == nil { - return nil - } - return o.Image -} - -func (o *UserOutput) GetLanguage() *string { - if o == nil { - return nil - } - return o.Language -} - -func (o *UserOutput) GetStatus() *string { - if o == nil { - return nil - } - return o.Status -} - -func (o *UserOutput) GetAddresses() []Address { - if o == nil { - return nil - } - return o.Addresses -} - -func (o *UserOutput) GetPhoneNumbers() []PhoneNumber { - if o == nil { - return nil - } - return o.PhoneNumbers -} - -func (o *UserOutput) GetEmails() []Email { - if o == nil { - return []Email{} - } - return o.Emails -} - -func (o *UserOutput) GetCustomMappings() map[string]any { - if o == nil { - return nil - } - return o.CustomMappings -} - -func (o *UserOutput) GetUpdatedAt() *string { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *UserOutput) GetCreatedAt() *string { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *UserOutput) GetPassThrough() []PassThroughBody { - if o == nil { - return nil - } - return o.PassThrough -} diff --git a/tests/mockserver/internal/sdk/models/components/validateconnectionstateresponse.go b/tests/mockserver/internal/sdk/models/components/validateconnectionstateresponse.go deleted file mode 100644 index bc5cbd64..00000000 --- a/tests/mockserver/internal/sdk/models/components/validateconnectionstateresponse.go +++ /dev/null @@ -1,63 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type ValidateConnectionStateResponseData struct { - // The unique identifier of the connection. - ID *string `json:"id,omitempty"` - // [Connection state flow](#section/Connection-state) - State *ConnectionState `json:"state,omitempty"` -} - -func (o *ValidateConnectionStateResponseData) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *ValidateConnectionStateResponseData) GetState() *ConnectionState { - if o == nil { - return nil - } - return o.State -} - -// ValidateConnectionStateResponse - Connection access token refreshed -type ValidateConnectionStateResponse struct { - // HTTP Response Status Code - StatusCode int64 `json:"status_code"` - // HTTP Response Status - Status string `json:"status"` - Data ValidateConnectionStateResponseData `json:"data"` - // Raw response from the integration when raw=true query param is provided - Raw map[string]any `json:"_raw,omitempty"` -} - -func (o *ValidateConnectionStateResponse) GetStatusCode() int64 { - if o == nil { - return 0 - } - return o.StatusCode -} - -func (o *ValidateConnectionStateResponse) GetStatus() string { - if o == nil { - return "" - } - return o.Status -} - -func (o *ValidateConnectionStateResponse) GetData() ValidateConnectionStateResponseData { - if o == nil { - return ValidateConnectionStateResponseData{} - } - return o.Data -} - -func (o *ValidateConnectionStateResponse) GetRaw() map[string]any { - if o == nil { - return nil - } - return o.Raw -} diff --git a/tests/mockserver/internal/sdk/models/components/webhook.go b/tests/mockserver/internal/sdk/models/components/webhook.go deleted file mode 100644 index 1a7012ac..00000000 --- a/tests/mockserver/internal/sdk/models/components/webhook.go +++ /dev/null @@ -1,143 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" - "time" -) - -// DisabledReason - Indicates if the webhook has has been disabled as it reached its retry limit or if account is over the usage allocated by it's plan. -type DisabledReason string - -const ( - DisabledReasonNone DisabledReason = "none" - DisabledReasonRetryLimit DisabledReason = "retry_limit" - DisabledReasonUsageLimit DisabledReason = "usage_limit" -) - -func (e DisabledReason) ToPointer() *DisabledReason { - return &e -} -func (e *DisabledReason) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "none": - fallthrough - case "retry_limit": - fallthrough - case "usage_limit": - *e = DisabledReason(v) - return nil - default: - return fmt.Errorf("invalid value for DisabledReason: %v", v) - } -} - -type Webhook struct { - ID *string `json:"id,omitempty"` - // A description of the object. - Description *string `json:"description,omitempty"` - // Name of Apideck Unified API - UnifiedAPI UnifiedAPIID `json:"unified_api"` - // The status of the webhook. - Status Status `json:"status"` - // Indicates if the webhook has has been disabled as it reached its retry limit or if account is over the usage allocated by it's plan. - DisabledReason *DisabledReason `json:"disabled_reason,omitempty"` - // The delivery url of the webhook endpoint. - DeliveryURL string `json:"delivery_url"` - // The Unify Base URL events from connectors will be sent to after service id is appended. - ExecuteBaseURL string `json:"execute_base_url"` - // The list of subscribed events for this webhook. [`*`] indicates that all events are enabled. - Events []WebhookEventType `json:"events"` - // The date and time when the object was last updated. - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The date and time when the object was created. - CreatedAt *time.Time `json:"created_at,omitempty"` -} - -func (w Webhook) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(w, "", false) -} - -func (w *Webhook) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &w, "", false, false); err != nil { - return err - } - return nil -} - -func (o *Webhook) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Webhook) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *Webhook) GetUnifiedAPI() UnifiedAPIID { - if o == nil { - return UnifiedAPIID("") - } - return o.UnifiedAPI -} - -func (o *Webhook) GetStatus() Status { - if o == nil { - return Status("") - } - return o.Status -} - -func (o *Webhook) GetDisabledReason() *DisabledReason { - if o == nil { - return nil - } - return o.DisabledReason -} - -func (o *Webhook) GetDeliveryURL() string { - if o == nil { - return "" - } - return o.DeliveryURL -} - -func (o *Webhook) GetExecuteBaseURL() string { - if o == nil { - return "" - } - return o.ExecuteBaseURL -} - -func (o *Webhook) GetEvents() []WebhookEventType { - if o == nil { - return []WebhookEventType{} - } - return o.Events -} - -func (o *Webhook) GetUpdatedAt() *time.Time { - if o == nil { - return nil - } - return o.UpdatedAt -} - -func (o *Webhook) GetCreatedAt() *time.Time { - if o == nil { - return nil - } - return o.CreatedAt -} diff --git a/tests/mockserver/internal/sdk/models/components/webhookeventlog.go b/tests/mockserver/internal/sdk/models/components/webhookeventlog.go deleted file mode 100644 index d8d3d1ca..00000000 --- a/tests/mockserver/internal/sdk/models/components/webhookeventlog.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// WebhookEventLogService - Apideck service provider associated with event. -type WebhookEventLogService struct { - // Apideck service provider id. - ID string `json:"id"` - // Apideck service provider name. - Name string `json:"name"` -} - -func (o *WebhookEventLogService) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *WebhookEventLogService) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -type Attempt struct { - // ISO Date and time when the request was made. - Timestamp *string `json:"timestamp,omitempty"` - // Number of attempts webhook endpoint was called before a success was returned or eventually failed - ExecutionAttempt *float64 `json:"execution_attempt,omitempty"` - // HTTP Status code that was returned. - StatusCode *int64 `json:"status_code,omitempty"` - // Whether or not the request was successful. - Success *bool `json:"success,omitempty"` -} - -func (o *Attempt) GetTimestamp() *string { - if o == nil { - return nil - } - return o.Timestamp -} - -func (o *Attempt) GetExecutionAttempt() *float64 { - if o == nil { - return nil - } - return o.ExecutionAttempt -} - -func (o *Attempt) GetStatusCode() *int64 { - if o == nil { - return nil - } - return o.StatusCode -} - -func (o *Attempt) GetSuccess() *bool { - if o == nil { - return nil - } - return o.Success -} - -type WebhookEventLog struct { - ID *string `json:"id,omitempty"` - // HTTP Status code that was returned. - StatusCode *int64 `json:"status_code,omitempty"` - // Whether or not the request was successful. - Success *bool `json:"success,omitempty"` - // ID of your Apideck Application - ApplicationID *string `json:"application_id,omitempty"` - // Unique consumer identifier. You can freely choose a consumer ID yourself. Most of the time, this is an ID of your internal data model that represents a user or account in your system (for example account:12345). If the consumer doesn't exist yet, Vault will upsert a consumer based on your ID. - ConsumerID *string `json:"consumer_id,omitempty"` - // Name of Apideck Unified API - UnifiedAPI *UnifiedAPIID `json:"unified_api,omitempty"` - // Apideck service provider associated with event. - Service *WebhookEventLogService `json:"service,omitempty"` - // The URL of the webhook endpoint. - Endpoint *string `json:"endpoint,omitempty"` - // Name of source event that webhook is subscribed to. - EventType *string `json:"event_type,omitempty"` - // Number of attempts webhook endpoint was called before a success was returned or eventually failed - ExecutionAttempt *float64 `json:"execution_attempt,omitempty"` - // HTTP Method of request to endpoint. - HTTPMethod *string `json:"http_method,omitempty"` - // ISO Date and time when the request was made. - Timestamp *string `json:"timestamp,omitempty"` - // Name of the Entity described by the attributes delivered within payload - EntityType *string `json:"entity_type,omitempty"` - // The JSON stringified payload that was delivered to the webhook endpoint. - RequestBody *string `json:"request_body,omitempty"` - // The JSON stringified response that was returned from the webhook endpoint. - ResponseBody *string `json:"response_body,omitempty"` - // If the request has not hit the max retry limit and will be retried. - RetryScheduled *bool `json:"retry_scheduled,omitempty"` - // record of each attempt to call webhook endpoint - Attempts []Attempt `json:"attempts,omitempty"` -} - -func (o *WebhookEventLog) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *WebhookEventLog) GetStatusCode() *int64 { - if o == nil { - return nil - } - return o.StatusCode -} - -func (o *WebhookEventLog) GetSuccess() *bool { - if o == nil { - return nil - } - return o.Success -} - -func (o *WebhookEventLog) GetApplicationID() *string { - if o == nil { - return nil - } - return o.ApplicationID -} - -func (o *WebhookEventLog) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *WebhookEventLog) GetUnifiedAPI() *UnifiedAPIID { - if o == nil { - return nil - } - return o.UnifiedAPI -} - -func (o *WebhookEventLog) GetService() *WebhookEventLogService { - if o == nil { - return nil - } - return o.Service -} - -func (o *WebhookEventLog) GetEndpoint() *string { - if o == nil { - return nil - } - return o.Endpoint -} - -func (o *WebhookEventLog) GetEventType() *string { - if o == nil { - return nil - } - return o.EventType -} - -func (o *WebhookEventLog) GetExecutionAttempt() *float64 { - if o == nil { - return nil - } - return o.ExecutionAttempt -} - -func (o *WebhookEventLog) GetHTTPMethod() *string { - if o == nil { - return nil - } - return o.HTTPMethod -} - -func (o *WebhookEventLog) GetTimestamp() *string { - if o == nil { - return nil - } - return o.Timestamp -} - -func (o *WebhookEventLog) GetEntityType() *string { - if o == nil { - return nil - } - return o.EntityType -} - -func (o *WebhookEventLog) GetRequestBody() *string { - if o == nil { - return nil - } - return o.RequestBody -} - -func (o *WebhookEventLog) GetResponseBody() *string { - if o == nil { - return nil - } - return o.ResponseBody -} - -func (o *WebhookEventLog) GetRetryScheduled() *bool { - if o == nil { - return nil - } - return o.RetryScheduled -} - -func (o *WebhookEventLog) GetAttempts() []Attempt { - if o == nil { - return nil - } - return o.Attempts -} diff --git a/tests/mockserver/internal/sdk/models/components/webhookeventlogsfilter.go b/tests/mockserver/internal/sdk/models/components/webhookeventlogsfilter.go deleted file mode 100644 index 2f4141e7..00000000 --- a/tests/mockserver/internal/sdk/models/components/webhookeventlogsfilter.go +++ /dev/null @@ -1,57 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type WebhookEventLogsFilterService struct { - ID *string `queryParam:"name=id"` -} - -func (o *WebhookEventLogsFilterService) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -type WebhookEventLogsFilter struct { - ExcludeApis *string `queryParam:"name=exclude_apis"` - Service *WebhookEventLogsFilterService `queryParam:"name=service"` - ConsumerID *string `queryParam:"name=consumer_id"` - EntityType *string `queryParam:"name=entity_type"` - EventType *string `queryParam:"name=event_type"` -} - -func (o *WebhookEventLogsFilter) GetExcludeApis() *string { - if o == nil { - return nil - } - return o.ExcludeApis -} - -func (o *WebhookEventLogsFilter) GetService() *WebhookEventLogsFilterService { - if o == nil { - return nil - } - return o.Service -} - -func (o *WebhookEventLogsFilter) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *WebhookEventLogsFilter) GetEntityType() *string { - if o == nil { - return nil - } - return o.EntityType -} - -func (o *WebhookEventLogsFilter) GetEventType() *string { - if o == nil { - return nil - } - return o.EventType -} diff --git a/tests/mockserver/internal/sdk/models/components/webhookeventtype.go b/tests/mockserver/internal/sdk/models/components/webhookeventtype.go deleted file mode 100644 index a5faaf6f..00000000 --- a/tests/mockserver/internal/sdk/models/components/webhookeventtype.go +++ /dev/null @@ -1,379 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -type WebhookEventType string - -const ( - WebhookEventTypeWildcard WebhookEventType = "*" - WebhookEventTypeCrmActivityCreated WebhookEventType = "crm.activity.created" - WebhookEventTypeCrmActivityUpdated WebhookEventType = "crm.activity.updated" - WebhookEventTypeCrmActivityDeleted WebhookEventType = "crm.activity.deleted" - WebhookEventTypeCrmCompanyCreated WebhookEventType = "crm.company.created" - WebhookEventTypeCrmCompanyUpdated WebhookEventType = "crm.company.updated" - WebhookEventTypeCrmCompanyDeleted WebhookEventType = "crm.company.deleted" - WebhookEventTypeCrmContactCreated WebhookEventType = "crm.contact.created" - WebhookEventTypeCrmContactUpdated WebhookEventType = "crm.contact.updated" - WebhookEventTypeCrmContactDeleted WebhookEventType = "crm.contact.deleted" - WebhookEventTypeCrmLeadCreated WebhookEventType = "crm.lead.created" - WebhookEventTypeCrmLeadUpdated WebhookEventType = "crm.lead.updated" - WebhookEventTypeCrmLeadDeleted WebhookEventType = "crm.lead.deleted" - WebhookEventTypeCrmNoteCreated WebhookEventType = "crm.note.created" - WebhookEventTypeCrmNotesUpdated WebhookEventType = "crm.notes.updated" - WebhookEventTypeCrmNotesDeleted WebhookEventType = "crm.notes.deleted" - WebhookEventTypeCrmOpportunityCreated WebhookEventType = "crm.opportunity.created" - WebhookEventTypeCrmOpportunityUpdated WebhookEventType = "crm.opportunity.updated" - WebhookEventTypeCrmOpportunityDeleted WebhookEventType = "crm.opportunity.deleted" - WebhookEventTypeLeadLeadCreated WebhookEventType = "lead.lead.created" - WebhookEventTypeLeadLeadUpdated WebhookEventType = "lead.lead.updated" - WebhookEventTypeLeadLeadDeleted WebhookEventType = "lead.lead.deleted" - WebhookEventTypeVaultConnectionCreated WebhookEventType = "vault.connection.created" - WebhookEventTypeVaultConnectionUpdated WebhookEventType = "vault.connection.updated" - WebhookEventTypeVaultConnectionDisabled WebhookEventType = "vault.connection.disabled" - WebhookEventTypeVaultConnectionDeleted WebhookEventType = "vault.connection.deleted" - WebhookEventTypeVaultConnectionCallable WebhookEventType = "vault.connection.callable" - WebhookEventTypeVaultConnectionRevoked WebhookEventType = "vault.connection.revoked" - WebhookEventTypeVaultConnectionTokenRefreshFailed WebhookEventType = "vault.connection.token_refresh.failed" - WebhookEventTypeAtsJobCreated WebhookEventType = "ats.job.created" - WebhookEventTypeAtsJobUpdated WebhookEventType = "ats.job.updated" - WebhookEventTypeAtsJobDeleted WebhookEventType = "ats.job.deleted" - WebhookEventTypeAtsApplicantCreated WebhookEventType = "ats.applicant.created" - WebhookEventTypeAtsApplicantUpdated WebhookEventType = "ats.applicant.updated" - WebhookEventTypeAtsApplicantDeleted WebhookEventType = "ats.applicant.deleted" - WebhookEventTypeAccountingCustomerCreated WebhookEventType = "accounting.customer.created" - WebhookEventTypeAccountingCustomerUpdated WebhookEventType = "accounting.customer.updated" - WebhookEventTypeAccountingCustomerDeleted WebhookEventType = "accounting.customer.deleted" - WebhookEventTypeAccountingInvoiceCreated WebhookEventType = "accounting.invoice.created" - WebhookEventTypeAccountingInvoiceUpdated WebhookEventType = "accounting.invoice.updated" - WebhookEventTypeAccountingInvoiceDeleted WebhookEventType = "accounting.invoice.deleted" - WebhookEventTypeAccountingInvoiceItemCreated WebhookEventType = "accounting.invoice_item.created" - WebhookEventTypeAccountingInvoiceItemUpdated WebhookEventType = "accounting.invoice_item.updated" - WebhookEventTypeAccountingInvoiceItemDeleted WebhookEventType = "accounting.invoice_item.deleted" - WebhookEventTypeAccountingLedgerAccountCreated WebhookEventType = "accounting.ledger_account.created" - WebhookEventTypeAccountingLedgerAccountUpdated WebhookEventType = "accounting.ledger_account.updated" - WebhookEventTypeAccountingLedgerAccountDeleted WebhookEventType = "accounting.ledger_account.deleted" - WebhookEventTypeAccountingTaxRateCreated WebhookEventType = "accounting.tax_rate.created" - WebhookEventTypeAccountingTaxRateUpdated WebhookEventType = "accounting.tax_rate.updated" - WebhookEventTypeAccountingTaxRateDeleted WebhookEventType = "accounting.tax_rate.deleted" - WebhookEventTypeAccountingBillCreated WebhookEventType = "accounting.bill.created" - WebhookEventTypeAccountingBillUpdated WebhookEventType = "accounting.bill.updated" - WebhookEventTypeAccountingBillDeleted WebhookEventType = "accounting.bill.deleted" - WebhookEventTypeAccountingPaymentCreated WebhookEventType = "accounting.payment.created" - WebhookEventTypeAccountingPaymentUpdated WebhookEventType = "accounting.payment.updated" - WebhookEventTypeAccountingPaymentDeleted WebhookEventType = "accounting.payment.deleted" - WebhookEventTypeAccountingSupplierCreated WebhookEventType = "accounting.supplier.created" - WebhookEventTypeAccountingSupplierUpdated WebhookEventType = "accounting.supplier.updated" - WebhookEventTypeAccountingSupplierDeleted WebhookEventType = "accounting.supplier.deleted" - WebhookEventTypeAccountingPurchaseOrderCreated WebhookEventType = "accounting.purchase_order.created" - WebhookEventTypeAccountingPurchaseOrderUpdated WebhookEventType = "accounting.purchase_order.updated" - WebhookEventTypeAccountingPurchaseOrderDeleted WebhookEventType = "accounting.purchase_order.deleted" - WebhookEventTypeAccountingCreditNoteCreated WebhookEventType = "accounting.credit_note.created" - WebhookEventTypeAccountingCreditNoteUpdated WebhookEventType = "accounting.credit_note.updated" - WebhookEventTypeAccountingCreditNoteDeleted WebhookEventType = "accounting.credit_note.deleted" - WebhookEventTypePosOrderCreated WebhookEventType = "pos.order.created" - WebhookEventTypePosOrderUpdated WebhookEventType = "pos.order.updated" - WebhookEventTypePosOrderDeleted WebhookEventType = "pos.order.deleted" - WebhookEventTypePosProductCreated WebhookEventType = "pos.product.created" - WebhookEventTypePosProductUpdated WebhookEventType = "pos.product.updated" - WebhookEventTypePosProductDeleted WebhookEventType = "pos.product.deleted" - WebhookEventTypePosPaymentCreated WebhookEventType = "pos.payment.created" - WebhookEventTypePosPaymentUpdated WebhookEventType = "pos.payment.updated" - WebhookEventTypePosPaymentDeleted WebhookEventType = "pos.payment.deleted" - WebhookEventTypePosMerchantCreated WebhookEventType = "pos.merchant.created" - WebhookEventTypePosMerchantUpdated WebhookEventType = "pos.merchant.updated" - WebhookEventTypePosMerchantDeleted WebhookEventType = "pos.merchant.deleted" - WebhookEventTypePosLocationCreated WebhookEventType = "pos.location.created" - WebhookEventTypePosLocationUpdated WebhookEventType = "pos.location.updated" - WebhookEventTypePosLocationDeleted WebhookEventType = "pos.location.deleted" - WebhookEventTypePosItemCreated WebhookEventType = "pos.item.created" - WebhookEventTypePosItemUpdated WebhookEventType = "pos.item.updated" - WebhookEventTypePosItemDeleted WebhookEventType = "pos.item.deleted" - WebhookEventTypePosModifierCreated WebhookEventType = "pos.modifier.created" - WebhookEventTypePosModifierUpdated WebhookEventType = "pos.modifier.updated" - WebhookEventTypePosModifierDeleted WebhookEventType = "pos.modifier.deleted" - WebhookEventTypePosModifierGroupCreated WebhookEventType = "pos.modifier-group.created" - WebhookEventTypePosModifierGroupUpdated WebhookEventType = "pos.modifier-group.updated" - WebhookEventTypePosModifierGroupDeleted WebhookEventType = "pos.modifier-group.deleted" - WebhookEventTypeHrisEmployeeCreated WebhookEventType = "hris.employee.created" - WebhookEventTypeHrisEmployeeUpdated WebhookEventType = "hris.employee.updated" - WebhookEventTypeHrisEmployeeDeleted WebhookEventType = "hris.employee.deleted" - WebhookEventTypeHrisEmployeeTerminated WebhookEventType = "hris.employee.terminated" - WebhookEventTypeHrisCompanyCreated WebhookEventType = "hris.company.created" - WebhookEventTypeHrisCompanyUpdated WebhookEventType = "hris.company.updated" - WebhookEventTypeHrisCompanyDeleted WebhookEventType = "hris.company.deleted" - WebhookEventTypeFileStorageFileCreated WebhookEventType = "file-storage.file.created" - WebhookEventTypeFileStorageFileUpdated WebhookEventType = "file-storage.file.updated" - WebhookEventTypeFileStorageFileDeleted WebhookEventType = "file-storage.file.deleted" - WebhookEventTypeIssueTrackingTicketCreated WebhookEventType = "issue-tracking.ticket.created" - WebhookEventTypeIssueTrackingTicketUpdated WebhookEventType = "issue-tracking.ticket.updated" - WebhookEventTypeIssueTrackingTicketDeleted WebhookEventType = "issue-tracking.ticket.deleted" - WebhookEventTypeAtsApplicationCreated WebhookEventType = "ats.application.created" - WebhookEventTypeAtsApplicationUpdated WebhookEventType = "ats.application.updated" - WebhookEventTypeAtsApplicationDeleted WebhookEventType = "ats.application.deleted" - WebhookEventTypeAccountingExpenseCreated WebhookEventType = "accounting.expense.created" - WebhookEventTypeAccountingExpenseUpdated WebhookEventType = "accounting.expense.updated" - WebhookEventTypeAccountingExpenseDeleted WebhookEventType = "accounting.expense.deleted" - WebhookEventTypeEcommerceOrderCreated WebhookEventType = "ecommerce.order.created" - WebhookEventTypeEcommerceOrderUpdated WebhookEventType = "ecommerce.order.updated" - WebhookEventTypeEcommerceOrderDeleted WebhookEventType = "ecommerce.order.deleted" - WebhookEventTypeEcommerceProductCreated WebhookEventType = "ecommerce.product.created" - WebhookEventTypeEcommerceProductUpdated WebhookEventType = "ecommerce.product.updated" - WebhookEventTypeEcommerceProductDeleted WebhookEventType = "ecommerce.product.deleted" - WebhookEventTypeEcommerceCustomerCreated WebhookEventType = "ecommerce.customer.created" - WebhookEventTypeEcommerceCustomerUpdated WebhookEventType = "ecommerce.customer.updated" - WebhookEventTypeEcommerceCustomerDeleted WebhookEventType = "ecommerce.customer.deleted" -) - -func (e WebhookEventType) ToPointer() *WebhookEventType { - return &e -} -func (e *WebhookEventType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "*": - fallthrough - case "crm.activity.created": - fallthrough - case "crm.activity.updated": - fallthrough - case "crm.activity.deleted": - fallthrough - case "crm.company.created": - fallthrough - case "crm.company.updated": - fallthrough - case "crm.company.deleted": - fallthrough - case "crm.contact.created": - fallthrough - case "crm.contact.updated": - fallthrough - case "crm.contact.deleted": - fallthrough - case "crm.lead.created": - fallthrough - case "crm.lead.updated": - fallthrough - case "crm.lead.deleted": - fallthrough - case "crm.note.created": - fallthrough - case "crm.notes.updated": - fallthrough - case "crm.notes.deleted": - fallthrough - case "crm.opportunity.created": - fallthrough - case "crm.opportunity.updated": - fallthrough - case "crm.opportunity.deleted": - fallthrough - case "lead.lead.created": - fallthrough - case "lead.lead.updated": - fallthrough - case "lead.lead.deleted": - fallthrough - case "vault.connection.created": - fallthrough - case "vault.connection.updated": - fallthrough - case "vault.connection.disabled": - fallthrough - case "vault.connection.deleted": - fallthrough - case "vault.connection.callable": - fallthrough - case "vault.connection.revoked": - fallthrough - case "vault.connection.token_refresh.failed": - fallthrough - case "ats.job.created": - fallthrough - case "ats.job.updated": - fallthrough - case "ats.job.deleted": - fallthrough - case "ats.applicant.created": - fallthrough - case "ats.applicant.updated": - fallthrough - case "ats.applicant.deleted": - fallthrough - case "accounting.customer.created": - fallthrough - case "accounting.customer.updated": - fallthrough - case "accounting.customer.deleted": - fallthrough - case "accounting.invoice.created": - fallthrough - case "accounting.invoice.updated": - fallthrough - case "accounting.invoice.deleted": - fallthrough - case "accounting.invoice_item.created": - fallthrough - case "accounting.invoice_item.updated": - fallthrough - case "accounting.invoice_item.deleted": - fallthrough - case "accounting.ledger_account.created": - fallthrough - case "accounting.ledger_account.updated": - fallthrough - case "accounting.ledger_account.deleted": - fallthrough - case "accounting.tax_rate.created": - fallthrough - case "accounting.tax_rate.updated": - fallthrough - case "accounting.tax_rate.deleted": - fallthrough - case "accounting.bill.created": - fallthrough - case "accounting.bill.updated": - fallthrough - case "accounting.bill.deleted": - fallthrough - case "accounting.payment.created": - fallthrough - case "accounting.payment.updated": - fallthrough - case "accounting.payment.deleted": - fallthrough - case "accounting.supplier.created": - fallthrough - case "accounting.supplier.updated": - fallthrough - case "accounting.supplier.deleted": - fallthrough - case "accounting.purchase_order.created": - fallthrough - case "accounting.purchase_order.updated": - fallthrough - case "accounting.purchase_order.deleted": - fallthrough - case "accounting.credit_note.created": - fallthrough - case "accounting.credit_note.updated": - fallthrough - case "accounting.credit_note.deleted": - fallthrough - case "pos.order.created": - fallthrough - case "pos.order.updated": - fallthrough - case "pos.order.deleted": - fallthrough - case "pos.product.created": - fallthrough - case "pos.product.updated": - fallthrough - case "pos.product.deleted": - fallthrough - case "pos.payment.created": - fallthrough - case "pos.payment.updated": - fallthrough - case "pos.payment.deleted": - fallthrough - case "pos.merchant.created": - fallthrough - case "pos.merchant.updated": - fallthrough - case "pos.merchant.deleted": - fallthrough - case "pos.location.created": - fallthrough - case "pos.location.updated": - fallthrough - case "pos.location.deleted": - fallthrough - case "pos.item.created": - fallthrough - case "pos.item.updated": - fallthrough - case "pos.item.deleted": - fallthrough - case "pos.modifier.created": - fallthrough - case "pos.modifier.updated": - fallthrough - case "pos.modifier.deleted": - fallthrough - case "pos.modifier-group.created": - fallthrough - case "pos.modifier-group.updated": - fallthrough - case "pos.modifier-group.deleted": - fallthrough - case "hris.employee.created": - fallthrough - case "hris.employee.updated": - fallthrough - case "hris.employee.deleted": - fallthrough - case "hris.employee.terminated": - fallthrough - case "hris.company.created": - fallthrough - case "hris.company.updated": - fallthrough - case "hris.company.deleted": - fallthrough - case "file-storage.file.created": - fallthrough - case "file-storage.file.updated": - fallthrough - case "file-storage.file.deleted": - fallthrough - case "issue-tracking.ticket.created": - fallthrough - case "issue-tracking.ticket.updated": - fallthrough - case "issue-tracking.ticket.deleted": - fallthrough - case "ats.application.created": - fallthrough - case "ats.application.updated": - fallthrough - case "ats.application.deleted": - fallthrough - case "accounting.expense.created": - fallthrough - case "accounting.expense.updated": - fallthrough - case "accounting.expense.deleted": - fallthrough - case "ecommerce.order.created": - fallthrough - case "ecommerce.order.updated": - fallthrough - case "ecommerce.order.deleted": - fallthrough - case "ecommerce.product.created": - fallthrough - case "ecommerce.product.updated": - fallthrough - case "ecommerce.product.deleted": - fallthrough - case "ecommerce.customer.created": - fallthrough - case "ecommerce.customer.updated": - fallthrough - case "ecommerce.customer.deleted": - *e = WebhookEventType(v) - return nil - default: - return fmt.Errorf("invalid value for WebhookEventType: %v", v) - } -} diff --git a/tests/mockserver/internal/sdk/models/components/webhooksubscription.go b/tests/mockserver/internal/sdk/models/components/webhooksubscription.go deleted file mode 100644 index 5bde3d1b..00000000 --- a/tests/mockserver/internal/sdk/models/components/webhooksubscription.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type WebhookSubscription struct { - // The ID of the downstream service - DownstreamID *string `json:"downstream_id,omitempty"` - // The list of Unify Events this connection is subscribed to - UnifyEventTypes []string `json:"unify_event_types,omitempty"` - // The list of downstream Events this connection is subscribed to - DownstreamEventTypes []string `json:"downstream_event_types,omitempty"` - // The URL the downstream is sending to when the event is triggered - ExecuteURL *string `json:"execute_url,omitempty"` - // The date and time the webhook subscription was created downstream - CreatedAt *string `json:"created_at,omitempty"` -} - -func (o *WebhookSubscription) GetDownstreamID() *string { - if o == nil { - return nil - } - return o.DownstreamID -} - -func (o *WebhookSubscription) GetUnifyEventTypes() []string { - if o == nil { - return nil - } - return o.UnifyEventTypes -} - -func (o *WebhookSubscription) GetDownstreamEventTypes() []string { - if o == nil { - return nil - } - return o.DownstreamEventTypes -} - -func (o *WebhookSubscription) GetExecuteURL() *string { - if o == nil { - return nil - } - return o.ExecuteURL -} - -func (o *WebhookSubscription) GetCreatedAt() *string { - if o == nil { - return nil - } - return o.CreatedAt -} diff --git a/tests/mockserver/internal/sdk/models/components/webhooksupport.go b/tests/mockserver/internal/sdk/models/components/webhooksupport.go deleted file mode 100644 index a9dfc71a..00000000 --- a/tests/mockserver/internal/sdk/models/components/webhooksupport.go +++ /dev/null @@ -1,229 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// WebhookSupportMode - Mode of the webhook support. -type WebhookSupportMode string - -const ( - WebhookSupportModeNative WebhookSupportMode = "native" - WebhookSupportModeVirtual WebhookSupportMode = "virtual" - WebhookSupportModeNone WebhookSupportMode = "none" -) - -func (e WebhookSupportMode) ToPointer() *WebhookSupportMode { - return &e -} -func (e *WebhookSupportMode) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "native": - fallthrough - case "virtual": - fallthrough - case "none": - *e = WebhookSupportMode(v) - return nil - default: - return fmt.Errorf("invalid value for WebhookSupportMode: %v", v) - } -} - -// SubscriptionLevel - Received events are scoped to connection or across integration. -type SubscriptionLevel string - -const ( - SubscriptionLevelConnection SubscriptionLevel = "connection" - SubscriptionLevelIntegration SubscriptionLevel = "integration" -) - -func (e SubscriptionLevel) ToPointer() *SubscriptionLevel { - return &e -} -func (e *SubscriptionLevel) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "connection": - fallthrough - case "integration": - *e = SubscriptionLevel(v) - return nil - default: - return fmt.Errorf("invalid value for SubscriptionLevel: %v", v) - } -} - -// ManagedVia - How the subscription is managed in the downstream. -type ManagedVia string - -const ( - ManagedViaManual ManagedVia = "manual" - ManagedViaAPI ManagedVia = "api" -) - -func (e ManagedVia) ToPointer() *ManagedVia { - return &e -} -func (e *ManagedVia) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "manual": - fallthrough - case "api": - *e = ManagedVia(v) - return nil - default: - return fmt.Errorf("invalid value for ManagedVia: %v", v) - } -} - -// Unit - The window unit for the rate. -type Unit string - -const ( - UnitSecond Unit = "second" - UnitMinute Unit = "minute" - UnitHour Unit = "hour" - UnitDay Unit = "day" -) - -func (e Unit) ToPointer() *Unit { - return &e -} -func (e *Unit) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "second": - fallthrough - case "minute": - fallthrough - case "hour": - fallthrough - case "day": - *e = Unit(v) - return nil - default: - return fmt.Errorf("invalid value for Unit: %v", v) - } -} - -// RequestRate - The rate at which requests for resources will be made to downstream. -type RequestRate struct { - // The number of requests per window unit. - Rate int64 `json:"rate"` - // Size of request window. - Size int64 `json:"size"` - // The window unit for the rate. - Unit Unit `json:"unit"` -} - -func (o *RequestRate) GetRate() int64 { - if o == nil { - return 0 - } - return o.Rate -} - -func (o *RequestRate) GetSize() int64 { - if o == nil { - return 0 - } - return o.Size -} - -func (o *RequestRate) GetUnit() Unit { - if o == nil { - return Unit("") - } - return o.Unit -} - -type Resources struct { - Events []string `json:"events,omitempty"` -} - -func (o *Resources) GetEvents() []string { - if o == nil { - return nil - } - return o.Events -} - -// VirtualWebhooks - Virtual webhook config for the connector. -type VirtualWebhooks struct { - // The rate at which requests for resources will be made to downstream. - RequestRate RequestRate `json:"request_rate"` - // The resources that will be requested from downstream. - Resources map[string]Resources `json:"resources,omitempty"` -} - -func (o *VirtualWebhooks) GetRequestRate() RequestRate { - if o == nil { - return RequestRate{} - } - return o.RequestRate -} - -func (o *VirtualWebhooks) GetResources() map[string]Resources { - if o == nil { - return nil - } - return o.Resources -} - -// WebhookSupport - How webhooks are supported for the connector. Sometimes the connector natively supports webhooks, other times Apideck virtualizes them based on polling. -type WebhookSupport struct { - // Mode of the webhook support. - Mode *WebhookSupportMode `json:"mode,omitempty"` - // Received events are scoped to connection or across integration. - SubscriptionLevel *SubscriptionLevel `json:"subscription_level,omitempty"` - // How the subscription is managed in the downstream. - ManagedVia *ManagedVia `json:"managed_via,omitempty"` - // Virtual webhook config for the connector. - VirtualWebhooks *VirtualWebhooks `json:"virtual_webhooks,omitempty"` -} - -func (o *WebhookSupport) GetMode() *WebhookSupportMode { - if o == nil { - return nil - } - return o.Mode -} - -func (o *WebhookSupport) GetSubscriptionLevel() *SubscriptionLevel { - if o == nil { - return nil - } - return o.SubscriptionLevel -} - -func (o *WebhookSupport) GetManagedVia() *ManagedVia { - if o == nil { - return nil - } - return o.ManagedVia -} - -func (o *WebhookSupport) GetVirtualWebhooks() *VirtualWebhooks { - if o == nil { - return nil - } - return o.VirtualWebhooks -} diff --git a/tests/mockserver/internal/sdk/models/components/website.go b/tests/mockserver/internal/sdk/models/components/website.go deleted file mode 100644 index 637db8ed..00000000 --- a/tests/mockserver/internal/sdk/models/components/website.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// WebsiteType - The type of website -type WebsiteType string - -const ( - WebsiteTypePrimary WebsiteType = "primary" - WebsiteTypeSecondary WebsiteType = "secondary" - WebsiteTypeWork WebsiteType = "work" - WebsiteTypePersonal WebsiteType = "personal" - WebsiteTypeOther WebsiteType = "other" -) - -func (e WebsiteType) ToPointer() *WebsiteType { - return &e -} -func (e *WebsiteType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "primary": - fallthrough - case "secondary": - fallthrough - case "work": - fallthrough - case "personal": - fallthrough - case "other": - *e = WebsiteType(v) - return nil - default: - return fmt.Errorf("invalid value for WebsiteType: %v", v) - } -} - -type Website struct { - // Unique identifier for the website - ID *string `json:"id,omitempty"` - // The website URL - URL string `json:"url"` - // The type of website - Type *WebsiteType `json:"type,omitempty"` -} - -func (o *Website) GetID() *string { - if o == nil { - return nil - } - return o.ID -} - -func (o *Website) GetURL() string { - if o == nil { - return "" - } - return o.URL -} - -func (o *Website) GetType() *WebsiteType { - if o == nil { - return nil - } - return o.Type -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingagedcreditorsone.go b/tests/mockserver/internal/sdk/models/operations/accountingagedcreditorsone.go deleted file mode 100644 index ce3d0ead..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingagedcreditorsone.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingAgedCreditorsOneGlobals 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 *AccountingAgedCreditorsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingAgedCreditorsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingAgedCreditorsOneRequest 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"` - // Apply filters - Filter *components.AgedReportFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // 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 AccountingAgedCreditorsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingAgedCreditorsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingAgedCreditorsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingAgedCreditorsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingAgedCreditorsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingAgedCreditorsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingAgedCreditorsOneRequest) GetFilter() *components.AgedReportFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *AccountingAgedCreditorsOneRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *AccountingAgedCreditorsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingAgedCreditorsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Aged Creditors - GetAgedCreditorsResponse *components.GetAgedCreditorsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingAgedCreditorsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingAgedCreditorsOneResponse) GetGetAgedCreditorsResponse() *components.GetAgedCreditorsResponse { - if o == nil { - return nil - } - return o.GetAgedCreditorsResponse -} - -func (o *AccountingAgedCreditorsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingageddebtorsone.go b/tests/mockserver/internal/sdk/models/operations/accountingageddebtorsone.go deleted file mode 100644 index dbeaf30f..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingageddebtorsone.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingAgedDebtorsOneGlobals 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 *AccountingAgedDebtorsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingAgedDebtorsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingAgedDebtorsOneRequest 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"` - // Apply filters - Filter *components.AgedReportFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // 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 AccountingAgedDebtorsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingAgedDebtorsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingAgedDebtorsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingAgedDebtorsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingAgedDebtorsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingAgedDebtorsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingAgedDebtorsOneRequest) GetFilter() *components.AgedReportFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *AccountingAgedDebtorsOneRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *AccountingAgedDebtorsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingAgedDebtorsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Aged Debtors - GetAgedDebtorsResponse *components.GetAgedDebtorsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingAgedDebtorsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingAgedDebtorsOneResponse) GetGetAgedDebtorsResponse() *components.GetAgedDebtorsResponse { - if o == nil { - return nil - } - return o.GetAgedDebtorsResponse -} - -func (o *AccountingAgedDebtorsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingattachmentsall.go b/tests/mockserver/internal/sdk/models/operations/accountingattachmentsall.go deleted file mode 100644 index e609f80b..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingattachmentsall.go +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingAttachmentsAllGlobals 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 *AccountingAttachmentsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingAttachmentsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingAttachmentsAllRequest struct { - // The reference type of the document. - ReferenceType components.AttachmentReferenceType `pathParam:"style=simple,explode=false,name=reference_type"` - // The reference id of the object to retrieve. - ReferenceID string `pathParam:"style=simple,explode=false,name=reference_id"` - // 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"` - // 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 AccountingAttachmentsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingAttachmentsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingAttachmentsAllRequest) GetReferenceType() components.AttachmentReferenceType { - if o == nil { - return components.AttachmentReferenceType("") - } - return o.ReferenceType -} - -func (o *AccountingAttachmentsAllRequest) GetReferenceID() string { - if o == nil { - return "" - } - return o.ReferenceID -} - -func (o *AccountingAttachmentsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingAttachmentsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingAttachmentsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingAttachmentsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingAttachmentsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AccountingAttachmentsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *AccountingAttachmentsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingAttachmentsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Attachments - GetAttachmentsResponse *components.GetAttachmentsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AccountingAttachmentsAllResponse, error) -} - -func (o *AccountingAttachmentsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingAttachmentsAllResponse) GetGetAttachmentsResponse() *components.GetAttachmentsResponse { - if o == nil { - return nil - } - return o.GetAttachmentsResponse -} - -func (o *AccountingAttachmentsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingattachmentsdelete.go b/tests/mockserver/internal/sdk/models/operations/accountingattachmentsdelete.go deleted file mode 100644 index 879ee7b5..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingattachmentsdelete.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingAttachmentsDeleteGlobals 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 *AccountingAttachmentsDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingAttachmentsDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingAttachmentsDeleteRequest struct { - // The reference type of the document. - ReferenceType components.AttachmentReferenceType `pathParam:"style=simple,explode=false,name=reference_type"` - // The reference id of the object to retrieve. - ReferenceID string `pathParam:"style=simple,explode=false,name=reference_id"` - // 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 AccountingAttachmentsDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingAttachmentsDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingAttachmentsDeleteRequest) GetReferenceType() components.AttachmentReferenceType { - if o == nil { - return components.AttachmentReferenceType("") - } - return o.ReferenceType -} - -func (o *AccountingAttachmentsDeleteRequest) GetReferenceID() string { - if o == nil { - return "" - } - return o.ReferenceID -} - -func (o *AccountingAttachmentsDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingAttachmentsDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingAttachmentsDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingAttachmentsDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingAttachmentsDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AccountingAttachmentsDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Attachments - DeleteAttachmentResponse *components.DeleteAttachmentResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingAttachmentsDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingAttachmentsDeleteResponse) GetDeleteAttachmentResponse() *components.DeleteAttachmentResponse { - if o == nil { - return nil - } - return o.DeleteAttachmentResponse -} - -func (o *AccountingAttachmentsDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingattachmentsdownload.go b/tests/mockserver/internal/sdk/models/operations/accountingattachmentsdownload.go deleted file mode 100644 index 8992270d..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingattachmentsdownload.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "io" - "mockserver/internal/sdk/models/components" -) - -type AccountingAttachmentsDownloadGlobals 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 *AccountingAttachmentsDownloadGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingAttachmentsDownloadGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingAttachmentsDownloadRequest struct { - // The reference type of the document. - ReferenceType components.AttachmentReferenceType `pathParam:"style=simple,explode=false,name=reference_type"` - // The reference id of the object to retrieve. - ReferenceID string `pathParam:"style=simple,explode=false,name=reference_id"` - // 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"` - // 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 (o *AccountingAttachmentsDownloadRequest) GetReferenceType() components.AttachmentReferenceType { - if o == nil { - return components.AttachmentReferenceType("") - } - return o.ReferenceType -} - -func (o *AccountingAttachmentsDownloadRequest) GetReferenceID() string { - if o == nil { - return "" - } - return o.ReferenceID -} - -func (o *AccountingAttachmentsDownloadRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingAttachmentsDownloadRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingAttachmentsDownloadRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingAttachmentsDownloadRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingAttachmentsDownloadRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingAttachmentsDownloadResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Attachment Download - // The Close method must be called on this field, even if it is not used, to prevent resource leaks. - GetAttachmentDownloadResponse io.ReadCloser - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingAttachmentsDownloadResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingAttachmentsDownloadResponse) GetGetAttachmentDownloadResponse() io.ReadCloser { - if o == nil { - return nil - } - return o.GetAttachmentDownloadResponse -} - -func (o *AccountingAttachmentsDownloadResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingattachmentsone.go b/tests/mockserver/internal/sdk/models/operations/accountingattachmentsone.go deleted file mode 100644 index 24999582..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingattachmentsone.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingAttachmentsOneGlobals 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 *AccountingAttachmentsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingAttachmentsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingAttachmentsOneRequest struct { - // The reference type of the document. - ReferenceType components.AttachmentReferenceType `pathParam:"style=simple,explode=false,name=reference_type"` - // The reference id of the object to retrieve. - ReferenceID string `pathParam:"style=simple,explode=false,name=reference_id"` - // 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 AccountingAttachmentsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingAttachmentsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingAttachmentsOneRequest) GetReferenceType() components.AttachmentReferenceType { - if o == nil { - return components.AttachmentReferenceType("") - } - return o.ReferenceType -} - -func (o *AccountingAttachmentsOneRequest) GetReferenceID() string { - if o == nil { - return "" - } - return o.ReferenceID -} - -func (o *AccountingAttachmentsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingAttachmentsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingAttachmentsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingAttachmentsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingAttachmentsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingAttachmentsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingAttachmentsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Attachments - GetAttachmentResponse *components.GetAttachmentResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingAttachmentsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingAttachmentsOneResponse) GetGetAttachmentResponse() *components.GetAttachmentResponse { - if o == nil { - return nil - } - return o.GetAttachmentResponse -} - -func (o *AccountingAttachmentsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingattachmentsupload.go b/tests/mockserver/internal/sdk/models/operations/accountingattachmentsupload.go deleted file mode 100644 index 5d5cace1..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingattachmentsupload.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "io" - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingAttachmentsUploadGlobals 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 *AccountingAttachmentsUploadGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingAttachmentsUploadGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingAttachmentsUploadRequest struct { - // The reference type of the document. - ReferenceType components.AttachmentReferenceType `pathParam:"style=simple,explode=false,name=reference_type"` - // The reference id of the object to retrieve. - ReferenceID string `pathParam:"style=simple,explode=false,name=reference_id"` - // Include raw response. Mostly used for debugging purposes - Raw *bool `default:"false" queryParam:"style=form,explode=true,name=raw"` - // Metadata to attach to the attachment file (JSON string) - XApideckMetadata *string `header:"style=simple,explode=false,name=x-apideck-metadata"` - // 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"` - RequestBody io.Reader `request:"mediaType=*/*"` -} - -func (a AccountingAttachmentsUploadRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingAttachmentsUploadRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingAttachmentsUploadRequest) GetReferenceType() components.AttachmentReferenceType { - if o == nil { - return components.AttachmentReferenceType("") - } - return o.ReferenceType -} - -func (o *AccountingAttachmentsUploadRequest) GetReferenceID() string { - if o == nil { - return "" - } - return o.ReferenceID -} - -func (o *AccountingAttachmentsUploadRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingAttachmentsUploadRequest) GetXApideckMetadata() *string { - if o == nil { - return nil - } - return o.XApideckMetadata -} - -func (o *AccountingAttachmentsUploadRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingAttachmentsUploadRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingAttachmentsUploadRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingAttachmentsUploadRequest) GetRequestBody() io.Reader { - if o == nil { - return nil - } - return o.RequestBody -} - -type AccountingAttachmentsUploadResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Attachments - CreateAttachmentResponse *components.CreateAttachmentResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingAttachmentsUploadResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingAttachmentsUploadResponse) GetCreateAttachmentResponse() *components.CreateAttachmentResponse { - if o == nil { - return nil - } - return o.CreateAttachmentResponse -} - -func (o *AccountingAttachmentsUploadResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingbalancesheetone.go b/tests/mockserver/internal/sdk/models/operations/accountingbalancesheetone.go deleted file mode 100644 index d1c8f40a..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingbalancesheetone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingBalanceSheetOneGlobals 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 *AccountingBalanceSheetOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBalanceSheetOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingBalanceSheetOneRequest 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"` - // 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"` - // 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"` - // Apply filters - Filter *components.BalanceSheetFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // Include raw response. Mostly used for debugging purposes - Raw *bool `default:"false" queryParam:"style=form,explode=true,name=raw"` -} - -func (a AccountingBalanceSheetOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingBalanceSheetOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingBalanceSheetOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBalanceSheetOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingBalanceSheetOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingBalanceSheetOneRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *AccountingBalanceSheetOneRequest) GetFilter() *components.BalanceSheetFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *AccountingBalanceSheetOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AccountingBalanceSheetOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // BalanceSheet - GetBalanceSheetResponse *components.GetBalanceSheetResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingBalanceSheetOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingBalanceSheetOneResponse) GetGetBalanceSheetResponse() *components.GetBalanceSheetResponse { - if o == nil { - return nil - } - return o.GetBalanceSheetResponse -} - -func (o *AccountingBalanceSheetOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingbankfeedaccountsadd.go b/tests/mockserver/internal/sdk/models/operations/accountingbankfeedaccountsadd.go deleted file mode 100644 index c16eeacb..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingbankfeedaccountsadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingBankFeedAccountsAddGlobals 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 *AccountingBankFeedAccountsAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBankFeedAccountsAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingBankFeedAccountsAddRequest 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"` - BankFeedAccount components.BankFeedAccountInput `request:"mediaType=application/json"` -} - -func (a AccountingBankFeedAccountsAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingBankFeedAccountsAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingBankFeedAccountsAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingBankFeedAccountsAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBankFeedAccountsAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingBankFeedAccountsAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingBankFeedAccountsAddRequest) GetBankFeedAccount() components.BankFeedAccountInput { - if o == nil { - return components.BankFeedAccountInput{} - } - return o.BankFeedAccount -} - -type AccountingBankFeedAccountsAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Bank Feed Accounts - CreateBankFeedAccountResponse *components.CreateBankFeedAccountResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingBankFeedAccountsAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingBankFeedAccountsAddResponse) GetCreateBankFeedAccountResponse() *components.CreateBankFeedAccountResponse { - if o == nil { - return nil - } - return o.CreateBankFeedAccountResponse -} - -func (o *AccountingBankFeedAccountsAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingbankfeedaccountsall.go b/tests/mockserver/internal/sdk/models/operations/accountingbankfeedaccountsall.go deleted file mode 100644 index e0050cec..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingbankfeedaccountsall.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingBankFeedAccountsAllGlobals 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 *AccountingBankFeedAccountsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBankFeedAccountsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingBankFeedAccountsAllRequest 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"` - // 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 AccountingBankFeedAccountsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingBankFeedAccountsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingBankFeedAccountsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingBankFeedAccountsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBankFeedAccountsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingBankFeedAccountsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingBankFeedAccountsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AccountingBankFeedAccountsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *AccountingBankFeedAccountsAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *AccountingBankFeedAccountsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingBankFeedAccountsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Bank Feed Accounts - GetBankFeedAccountsResponse *components.GetBankFeedAccountsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AccountingBankFeedAccountsAllResponse, error) -} - -func (o *AccountingBankFeedAccountsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingBankFeedAccountsAllResponse) GetGetBankFeedAccountsResponse() *components.GetBankFeedAccountsResponse { - if o == nil { - return nil - } - return o.GetBankFeedAccountsResponse -} - -func (o *AccountingBankFeedAccountsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingbankfeedaccountsdelete.go b/tests/mockserver/internal/sdk/models/operations/accountingbankfeedaccountsdelete.go deleted file mode 100644 index 3ffba07a..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingbankfeedaccountsdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingBankFeedAccountsDeleteGlobals 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 *AccountingBankFeedAccountsDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBankFeedAccountsDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingBankFeedAccountsDeleteRequest 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 AccountingBankFeedAccountsDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingBankFeedAccountsDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingBankFeedAccountsDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingBankFeedAccountsDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBankFeedAccountsDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingBankFeedAccountsDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingBankFeedAccountsDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AccountingBankFeedAccountsDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Bank Feed Accounts - DeleteBankFeedAccountResponse *components.DeleteBankFeedAccountResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingBankFeedAccountsDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingBankFeedAccountsDeleteResponse) GetDeleteBankFeedAccountResponse() *components.DeleteBankFeedAccountResponse { - if o == nil { - return nil - } - return o.DeleteBankFeedAccountResponse -} - -func (o *AccountingBankFeedAccountsDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingbankfeedaccountsone.go b/tests/mockserver/internal/sdk/models/operations/accountingbankfeedaccountsone.go deleted file mode 100644 index c66174a2..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingbankfeedaccountsone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingBankFeedAccountsOneGlobals 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 *AccountingBankFeedAccountsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBankFeedAccountsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingBankFeedAccountsOneRequest 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 AccountingBankFeedAccountsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingBankFeedAccountsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingBankFeedAccountsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingBankFeedAccountsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBankFeedAccountsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingBankFeedAccountsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingBankFeedAccountsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingBankFeedAccountsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingBankFeedAccountsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Bank Feed Accounts - GetBankFeedAccountResponse *components.GetBankFeedAccountResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingBankFeedAccountsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingBankFeedAccountsOneResponse) GetGetBankFeedAccountResponse() *components.GetBankFeedAccountResponse { - if o == nil { - return nil - } - return o.GetBankFeedAccountResponse -} - -func (o *AccountingBankFeedAccountsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingbankfeedaccountsupdate.go b/tests/mockserver/internal/sdk/models/operations/accountingbankfeedaccountsupdate.go deleted file mode 100644 index e483f1f7..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingbankfeedaccountsupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingBankFeedAccountsUpdateGlobals 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 *AccountingBankFeedAccountsUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBankFeedAccountsUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingBankFeedAccountsUpdateRequest 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"` - BankFeedAccount components.BankFeedAccountInput `request:"mediaType=application/json"` -} - -func (a AccountingBankFeedAccountsUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingBankFeedAccountsUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingBankFeedAccountsUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingBankFeedAccountsUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBankFeedAccountsUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingBankFeedAccountsUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingBankFeedAccountsUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingBankFeedAccountsUpdateRequest) GetBankFeedAccount() components.BankFeedAccountInput { - if o == nil { - return components.BankFeedAccountInput{} - } - return o.BankFeedAccount -} - -type AccountingBankFeedAccountsUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Bank Feed Accounts - UpdateBankFeedAccountResponse *components.UpdateBankFeedAccountResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingBankFeedAccountsUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingBankFeedAccountsUpdateResponse) GetUpdateBankFeedAccountResponse() *components.UpdateBankFeedAccountResponse { - if o == nil { - return nil - } - return o.UpdateBankFeedAccountResponse -} - -func (o *AccountingBankFeedAccountsUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingbankfeedstatementsadd.go b/tests/mockserver/internal/sdk/models/operations/accountingbankfeedstatementsadd.go deleted file mode 100644 index e30aac31..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingbankfeedstatementsadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingBankFeedStatementsAddGlobals 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 *AccountingBankFeedStatementsAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBankFeedStatementsAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingBankFeedStatementsAddRequest 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"` - BankFeedStatement components.BankFeedStatementInput `request:"mediaType=application/json"` -} - -func (a AccountingBankFeedStatementsAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingBankFeedStatementsAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingBankFeedStatementsAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingBankFeedStatementsAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBankFeedStatementsAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingBankFeedStatementsAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingBankFeedStatementsAddRequest) GetBankFeedStatement() components.BankFeedStatementInput { - if o == nil { - return components.BankFeedStatementInput{} - } - return o.BankFeedStatement -} - -type AccountingBankFeedStatementsAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Bank Feed Statements - CreateBankFeedStatementResponse *components.CreateBankFeedStatementResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingBankFeedStatementsAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingBankFeedStatementsAddResponse) GetCreateBankFeedStatementResponse() *components.CreateBankFeedStatementResponse { - if o == nil { - return nil - } - return o.CreateBankFeedStatementResponse -} - -func (o *AccountingBankFeedStatementsAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingbankfeedstatementsall.go b/tests/mockserver/internal/sdk/models/operations/accountingbankfeedstatementsall.go deleted file mode 100644 index f30da068..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingbankfeedstatementsall.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingBankFeedStatementsAllGlobals 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 *AccountingBankFeedStatementsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBankFeedStatementsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingBankFeedStatementsAllRequest 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"` - // 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 AccountingBankFeedStatementsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingBankFeedStatementsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingBankFeedStatementsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingBankFeedStatementsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBankFeedStatementsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingBankFeedStatementsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingBankFeedStatementsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AccountingBankFeedStatementsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *AccountingBankFeedStatementsAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *AccountingBankFeedStatementsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingBankFeedStatementsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Bank Feed Statements - GetBankFeedStatementsResponse *components.GetBankFeedStatementsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AccountingBankFeedStatementsAllResponse, error) -} - -func (o *AccountingBankFeedStatementsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingBankFeedStatementsAllResponse) GetGetBankFeedStatementsResponse() *components.GetBankFeedStatementsResponse { - if o == nil { - return nil - } - return o.GetBankFeedStatementsResponse -} - -func (o *AccountingBankFeedStatementsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingbankfeedstatementsdelete.go b/tests/mockserver/internal/sdk/models/operations/accountingbankfeedstatementsdelete.go deleted file mode 100644 index a47aecaa..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingbankfeedstatementsdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingBankFeedStatementsDeleteGlobals 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 *AccountingBankFeedStatementsDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBankFeedStatementsDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingBankFeedStatementsDeleteRequest 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 AccountingBankFeedStatementsDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingBankFeedStatementsDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingBankFeedStatementsDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingBankFeedStatementsDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBankFeedStatementsDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingBankFeedStatementsDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingBankFeedStatementsDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AccountingBankFeedStatementsDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Bank Feed Statements - DeleteBankFeedStatementResponse *components.DeleteBankFeedStatementResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingBankFeedStatementsDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingBankFeedStatementsDeleteResponse) GetDeleteBankFeedStatementResponse() *components.DeleteBankFeedStatementResponse { - if o == nil { - return nil - } - return o.DeleteBankFeedStatementResponse -} - -func (o *AccountingBankFeedStatementsDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingbankfeedstatementsone.go b/tests/mockserver/internal/sdk/models/operations/accountingbankfeedstatementsone.go deleted file mode 100644 index e2ae20bd..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingbankfeedstatementsone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingBankFeedStatementsOneGlobals 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 *AccountingBankFeedStatementsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBankFeedStatementsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingBankFeedStatementsOneRequest 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 AccountingBankFeedStatementsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingBankFeedStatementsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingBankFeedStatementsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingBankFeedStatementsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBankFeedStatementsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingBankFeedStatementsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingBankFeedStatementsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingBankFeedStatementsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingBankFeedStatementsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Bank Feed Statements - GetBankFeedStatementResponse *components.GetBankFeedStatementResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingBankFeedStatementsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingBankFeedStatementsOneResponse) GetGetBankFeedStatementResponse() *components.GetBankFeedStatementResponse { - if o == nil { - return nil - } - return o.GetBankFeedStatementResponse -} - -func (o *AccountingBankFeedStatementsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingbankfeedstatementsupdate.go b/tests/mockserver/internal/sdk/models/operations/accountingbankfeedstatementsupdate.go deleted file mode 100644 index ec059bfe..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingbankfeedstatementsupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingBankFeedStatementsUpdateGlobals 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 *AccountingBankFeedStatementsUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBankFeedStatementsUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingBankFeedStatementsUpdateRequest 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"` - BankFeedStatement components.BankFeedStatementInput `request:"mediaType=application/json"` -} - -func (a AccountingBankFeedStatementsUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingBankFeedStatementsUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingBankFeedStatementsUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingBankFeedStatementsUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBankFeedStatementsUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingBankFeedStatementsUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingBankFeedStatementsUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingBankFeedStatementsUpdateRequest) GetBankFeedStatement() components.BankFeedStatementInput { - if o == nil { - return components.BankFeedStatementInput{} - } - return o.BankFeedStatement -} - -type AccountingBankFeedStatementsUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Bank Feed Statements - UpdateBankFeedStatementResponse *components.UpdateBankFeedStatementResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingBankFeedStatementsUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingBankFeedStatementsUpdateResponse) GetUpdateBankFeedStatementResponse() *components.UpdateBankFeedStatementResponse { - if o == nil { - return nil - } - return o.UpdateBankFeedStatementResponse -} - -func (o *AccountingBankFeedStatementsUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingbillpaymentsadd.go b/tests/mockserver/internal/sdk/models/operations/accountingbillpaymentsadd.go deleted file mode 100644 index 5f2bad7f..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingbillpaymentsadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingBillPaymentsAddGlobals 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 *AccountingBillPaymentsAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBillPaymentsAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingBillPaymentsAddRequest 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"` - BillPayment components.BillPaymentInput `request:"mediaType=application/json"` -} - -func (a AccountingBillPaymentsAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingBillPaymentsAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingBillPaymentsAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingBillPaymentsAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBillPaymentsAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingBillPaymentsAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingBillPaymentsAddRequest) GetBillPayment() components.BillPaymentInput { - if o == nil { - return components.BillPaymentInput{} - } - return o.BillPayment -} - -type AccountingBillPaymentsAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Bill Payment created - CreateBillPaymentResponse *components.CreateBillPaymentResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingBillPaymentsAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingBillPaymentsAddResponse) GetCreateBillPaymentResponse() *components.CreateBillPaymentResponse { - if o == nil { - return nil - } - return o.CreateBillPaymentResponse -} - -func (o *AccountingBillPaymentsAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingbillpaymentsall.go b/tests/mockserver/internal/sdk/models/operations/accountingbillpaymentsall.go deleted file mode 100644 index 48a7b4a0..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingbillpaymentsall.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingBillPaymentsAllGlobals 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 *AccountingBillPaymentsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBillPaymentsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingBillPaymentsAllRequest 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.PaymentsFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // Apply sorting - Sort *components.PaymentsSort `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 AccountingBillPaymentsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingBillPaymentsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingBillPaymentsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingBillPaymentsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBillPaymentsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingBillPaymentsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingBillPaymentsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AccountingBillPaymentsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *AccountingBillPaymentsAllRequest) GetFilter() *components.PaymentsFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *AccountingBillPaymentsAllRequest) GetSort() *components.PaymentsSort { - if o == nil { - return nil - } - return o.Sort -} - -func (o *AccountingBillPaymentsAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *AccountingBillPaymentsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingBillPaymentsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Bill Payments - GetBillPaymentsResponse *components.GetBillPaymentsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AccountingBillPaymentsAllResponse, error) -} - -func (o *AccountingBillPaymentsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingBillPaymentsAllResponse) GetGetBillPaymentsResponse() *components.GetBillPaymentsResponse { - if o == nil { - return nil - } - return o.GetBillPaymentsResponse -} - -func (o *AccountingBillPaymentsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingbillpaymentsdelete.go b/tests/mockserver/internal/sdk/models/operations/accountingbillpaymentsdelete.go deleted file mode 100644 index e41c0040..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingbillpaymentsdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingBillPaymentsDeleteGlobals 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 *AccountingBillPaymentsDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBillPaymentsDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingBillPaymentsDeleteRequest 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 AccountingBillPaymentsDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingBillPaymentsDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingBillPaymentsDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingBillPaymentsDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBillPaymentsDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingBillPaymentsDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingBillPaymentsDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AccountingBillPaymentsDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Bill Payment deleted - DeleteBillPaymentResponse *components.DeleteBillPaymentResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingBillPaymentsDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingBillPaymentsDeleteResponse) GetDeleteBillPaymentResponse() *components.DeleteBillPaymentResponse { - if o == nil { - return nil - } - return o.DeleteBillPaymentResponse -} - -func (o *AccountingBillPaymentsDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingbillpaymentsone.go b/tests/mockserver/internal/sdk/models/operations/accountingbillpaymentsone.go deleted file mode 100644 index 642bf1c4..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingbillpaymentsone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingBillPaymentsOneGlobals 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 *AccountingBillPaymentsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBillPaymentsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingBillPaymentsOneRequest 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 AccountingBillPaymentsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingBillPaymentsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingBillPaymentsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingBillPaymentsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBillPaymentsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingBillPaymentsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingBillPaymentsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingBillPaymentsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingBillPaymentsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Bill Payment - GetBillPaymentResponse *components.GetBillPaymentResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingBillPaymentsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingBillPaymentsOneResponse) GetGetBillPaymentResponse() *components.GetBillPaymentResponse { - if o == nil { - return nil - } - return o.GetBillPaymentResponse -} - -func (o *AccountingBillPaymentsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingbillpaymentsupdate.go b/tests/mockserver/internal/sdk/models/operations/accountingbillpaymentsupdate.go deleted file mode 100644 index 81efd7e1..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingbillpaymentsupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingBillPaymentsUpdateGlobals 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 *AccountingBillPaymentsUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBillPaymentsUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingBillPaymentsUpdateRequest 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"` - BillPayment components.BillPaymentInput `request:"mediaType=application/json"` -} - -func (a AccountingBillPaymentsUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingBillPaymentsUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingBillPaymentsUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingBillPaymentsUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBillPaymentsUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingBillPaymentsUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingBillPaymentsUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingBillPaymentsUpdateRequest) GetBillPayment() components.BillPaymentInput { - if o == nil { - return components.BillPaymentInput{} - } - return o.BillPayment -} - -type AccountingBillPaymentsUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Bill Payment updated - UpdateBillPaymentResponse *components.UpdateBillPaymentResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingBillPaymentsUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingBillPaymentsUpdateResponse) GetUpdateBillPaymentResponse() *components.UpdateBillPaymentResponse { - if o == nil { - return nil - } - return o.UpdateBillPaymentResponse -} - -func (o *AccountingBillPaymentsUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingbillsadd.go b/tests/mockserver/internal/sdk/models/operations/accountingbillsadd.go deleted file mode 100644 index 791eb189..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingbillsadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingBillsAddGlobals 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 *AccountingBillsAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBillsAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingBillsAddRequest 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"` - Bill components.BillInput `request:"mediaType=application/json"` -} - -func (a AccountingBillsAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingBillsAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingBillsAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingBillsAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBillsAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingBillsAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingBillsAddRequest) GetBill() components.BillInput { - if o == nil { - return components.BillInput{} - } - return o.Bill -} - -type AccountingBillsAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Bill created - CreateBillResponse *components.CreateBillResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingBillsAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingBillsAddResponse) GetCreateBillResponse() *components.CreateBillResponse { - if o == nil { - return nil - } - return o.CreateBillResponse -} - -func (o *AccountingBillsAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingbillsall.go b/tests/mockserver/internal/sdk/models/operations/accountingbillsall.go deleted file mode 100644 index 8b84f537..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingbillsall.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingBillsAllGlobals 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 *AccountingBillsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBillsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingBillsAllRequest 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.BillsFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // Apply sorting - Sort *components.BillsSort `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 AccountingBillsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingBillsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingBillsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingBillsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBillsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingBillsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingBillsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AccountingBillsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *AccountingBillsAllRequest) GetFilter() *components.BillsFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *AccountingBillsAllRequest) GetSort() *components.BillsSort { - if o == nil { - return nil - } - return o.Sort -} - -func (o *AccountingBillsAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *AccountingBillsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingBillsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Bills - GetBillsResponse *components.GetBillsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AccountingBillsAllResponse, error) -} - -func (o *AccountingBillsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingBillsAllResponse) GetGetBillsResponse() *components.GetBillsResponse { - if o == nil { - return nil - } - return o.GetBillsResponse -} - -func (o *AccountingBillsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingbillsdelete.go b/tests/mockserver/internal/sdk/models/operations/accountingbillsdelete.go deleted file mode 100644 index 2509c30e..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingbillsdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingBillsDeleteGlobals 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 *AccountingBillsDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBillsDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingBillsDeleteRequest 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 AccountingBillsDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingBillsDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingBillsDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingBillsDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBillsDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingBillsDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingBillsDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AccountingBillsDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Bill deleted - DeleteBillResponse *components.DeleteBillResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingBillsDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingBillsDeleteResponse) GetDeleteBillResponse() *components.DeleteBillResponse { - if o == nil { - return nil - } - return o.DeleteBillResponse -} - -func (o *AccountingBillsDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingbillsone.go b/tests/mockserver/internal/sdk/models/operations/accountingbillsone.go deleted file mode 100644 index 0da48b38..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingbillsone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingBillsOneGlobals 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 *AccountingBillsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBillsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingBillsOneRequest 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 AccountingBillsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingBillsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingBillsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingBillsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBillsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingBillsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingBillsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingBillsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingBillsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Bill - GetBillResponse *components.GetBillResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingBillsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingBillsOneResponse) GetGetBillResponse() *components.GetBillResponse { - if o == nil { - return nil - } - return o.GetBillResponse -} - -func (o *AccountingBillsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingbillsupdate.go b/tests/mockserver/internal/sdk/models/operations/accountingbillsupdate.go deleted file mode 100644 index 136e6088..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingbillsupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingBillsUpdateGlobals 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 *AccountingBillsUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBillsUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingBillsUpdateRequest 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"` - Bill components.BillInput `request:"mediaType=application/json"` -} - -func (a AccountingBillsUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingBillsUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingBillsUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingBillsUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingBillsUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingBillsUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingBillsUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingBillsUpdateRequest) GetBill() components.BillInput { - if o == nil { - return components.BillInput{} - } - return o.Bill -} - -type AccountingBillsUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Bill Updated - UpdateBillResponse *components.UpdateBillResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingBillsUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingBillsUpdateResponse) GetUpdateBillResponse() *components.UpdateBillResponse { - if o == nil { - return nil - } - return o.UpdateBillResponse -} - -func (o *AccountingBillsUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingcategoriesall.go b/tests/mockserver/internal/sdk/models/operations/accountingcategoriesall.go deleted file mode 100644 index 83321973..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingcategoriesall.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingCategoriesAllGlobals 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 *AccountingCategoriesAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCategoriesAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingCategoriesAllRequest 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"` - // 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 AccountingCategoriesAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingCategoriesAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingCategoriesAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingCategoriesAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCategoriesAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingCategoriesAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingCategoriesAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AccountingCategoriesAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *AccountingCategoriesAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingCategoriesAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Categories - GetCategoriesResponse *components.GetCategoriesResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AccountingCategoriesAllResponse, error) -} - -func (o *AccountingCategoriesAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingCategoriesAllResponse) GetGetCategoriesResponse() *components.GetCategoriesResponse { - if o == nil { - return nil - } - return o.GetCategoriesResponse -} - -func (o *AccountingCategoriesAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingcategoriesone.go b/tests/mockserver/internal/sdk/models/operations/accountingcategoriesone.go deleted file mode 100644 index be47d890..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingcategoriesone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingCategoriesOneGlobals 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 *AccountingCategoriesOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCategoriesOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingCategoriesOneRequest 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 AccountingCategoriesOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingCategoriesOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingCategoriesOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingCategoriesOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCategoriesOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingCategoriesOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingCategoriesOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingCategoriesOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingCategoriesOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Category - GetCategoryResponse *components.GetCategoryResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingCategoriesOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingCategoriesOneResponse) GetGetCategoryResponse() *components.GetCategoryResponse { - if o == nil { - return nil - } - return o.GetCategoryResponse -} - -func (o *AccountingCategoriesOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingcompanyinfoone.go b/tests/mockserver/internal/sdk/models/operations/accountingcompanyinfoone.go deleted file mode 100644 index 3413a43a..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingcompanyinfoone.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingCompanyInfoOneGlobals 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 *AccountingCompanyInfoOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCompanyInfoOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingCompanyInfoOneRequest 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"` - // 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 AccountingCompanyInfoOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingCompanyInfoOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingCompanyInfoOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingCompanyInfoOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCompanyInfoOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingCompanyInfoOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingCompanyInfoOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingCompanyInfoOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // CompanyInfo - GetCompanyInfoResponse *components.GetCompanyInfoResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingCompanyInfoOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingCompanyInfoOneResponse) GetGetCompanyInfoResponse() *components.GetCompanyInfoResponse { - if o == nil { - return nil - } - return o.GetCompanyInfoResponse -} - -func (o *AccountingCompanyInfoOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingcreditnotesadd.go b/tests/mockserver/internal/sdk/models/operations/accountingcreditnotesadd.go deleted file mode 100644 index dc467674..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingcreditnotesadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingCreditNotesAddGlobals 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 *AccountingCreditNotesAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCreditNotesAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingCreditNotesAddRequest 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"` - CreditNote components.CreditNoteInput `request:"mediaType=application/json"` -} - -func (a AccountingCreditNotesAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingCreditNotesAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingCreditNotesAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingCreditNotesAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCreditNotesAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingCreditNotesAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingCreditNotesAddRequest) GetCreditNote() components.CreditNoteInput { - if o == nil { - return components.CreditNoteInput{} - } - return o.CreditNote -} - -type AccountingCreditNotesAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Credit Note created - CreateCreditNoteResponse *components.CreateCreditNoteResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingCreditNotesAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingCreditNotesAddResponse) GetCreateCreditNoteResponse() *components.CreateCreditNoteResponse { - if o == nil { - return nil - } - return o.CreateCreditNoteResponse -} - -func (o *AccountingCreditNotesAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingcreditnotesall.go b/tests/mockserver/internal/sdk/models/operations/accountingcreditnotesall.go deleted file mode 100644 index 33775299..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingcreditnotesall.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingCreditNotesAllGlobals 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 *AccountingCreditNotesAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCreditNotesAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingCreditNotesAllRequest 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.CreditNotesFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // Apply sorting - Sort *components.CreditNotesSort `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 AccountingCreditNotesAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingCreditNotesAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingCreditNotesAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingCreditNotesAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCreditNotesAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingCreditNotesAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingCreditNotesAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AccountingCreditNotesAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *AccountingCreditNotesAllRequest) GetFilter() *components.CreditNotesFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *AccountingCreditNotesAllRequest) GetSort() *components.CreditNotesSort { - if o == nil { - return nil - } - return o.Sort -} - -func (o *AccountingCreditNotesAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *AccountingCreditNotesAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingCreditNotesAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Credit Notes - GetCreditNotesResponse *components.GetCreditNotesResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AccountingCreditNotesAllResponse, error) -} - -func (o *AccountingCreditNotesAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingCreditNotesAllResponse) GetGetCreditNotesResponse() *components.GetCreditNotesResponse { - if o == nil { - return nil - } - return o.GetCreditNotesResponse -} - -func (o *AccountingCreditNotesAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingcreditnotesdelete.go b/tests/mockserver/internal/sdk/models/operations/accountingcreditnotesdelete.go deleted file mode 100644 index d80c55e1..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingcreditnotesdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingCreditNotesDeleteGlobals 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 *AccountingCreditNotesDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCreditNotesDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingCreditNotesDeleteRequest 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 AccountingCreditNotesDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingCreditNotesDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingCreditNotesDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingCreditNotesDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCreditNotesDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingCreditNotesDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingCreditNotesDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AccountingCreditNotesDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Credit Note deleted - DeleteCreditNoteResponse *components.DeleteCreditNoteResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingCreditNotesDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingCreditNotesDeleteResponse) GetDeleteCreditNoteResponse() *components.DeleteCreditNoteResponse { - if o == nil { - return nil - } - return o.DeleteCreditNoteResponse -} - -func (o *AccountingCreditNotesDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingcreditnotesone.go b/tests/mockserver/internal/sdk/models/operations/accountingcreditnotesone.go deleted file mode 100644 index 62debc3d..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingcreditnotesone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingCreditNotesOneGlobals 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 *AccountingCreditNotesOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCreditNotesOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingCreditNotesOneRequest 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 AccountingCreditNotesOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingCreditNotesOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingCreditNotesOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingCreditNotesOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCreditNotesOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingCreditNotesOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingCreditNotesOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingCreditNotesOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingCreditNotesOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Credit Note - GetCreditNoteResponse *components.GetCreditNoteResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingCreditNotesOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingCreditNotesOneResponse) GetGetCreditNoteResponse() *components.GetCreditNoteResponse { - if o == nil { - return nil - } - return o.GetCreditNoteResponse -} - -func (o *AccountingCreditNotesOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingcreditnotesupdate.go b/tests/mockserver/internal/sdk/models/operations/accountingcreditnotesupdate.go deleted file mode 100644 index 34c60df2..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingcreditnotesupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingCreditNotesUpdateGlobals 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 *AccountingCreditNotesUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCreditNotesUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingCreditNotesUpdateRequest 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"` - CreditNote components.CreditNoteInput `request:"mediaType=application/json"` -} - -func (a AccountingCreditNotesUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingCreditNotesUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingCreditNotesUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingCreditNotesUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCreditNotesUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingCreditNotesUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingCreditNotesUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingCreditNotesUpdateRequest) GetCreditNote() components.CreditNoteInput { - if o == nil { - return components.CreditNoteInput{} - } - return o.CreditNote -} - -type AccountingCreditNotesUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Credit Note updated - UpdateCreditNoteResponse *components.UpdateCreditNoteResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingCreditNotesUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingCreditNotesUpdateResponse) GetUpdateCreditNoteResponse() *components.UpdateCreditNoteResponse { - if o == nil { - return nil - } - return o.UpdateCreditNoteResponse -} - -func (o *AccountingCreditNotesUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingcustomersadd.go b/tests/mockserver/internal/sdk/models/operations/accountingcustomersadd.go deleted file mode 100644 index 961dee45..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingcustomersadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingCustomersAddGlobals 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 *AccountingCustomersAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCustomersAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingCustomersAddRequest 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"` - Customer components.CustomerInput `request:"mediaType=application/json"` -} - -func (a AccountingCustomersAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingCustomersAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingCustomersAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingCustomersAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCustomersAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingCustomersAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingCustomersAddRequest) GetCustomer() components.CustomerInput { - if o == nil { - return components.CustomerInput{} - } - return o.Customer -} - -type AccountingCustomersAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Customers - CreateCustomerResponse *components.CreateCustomerResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingCustomersAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingCustomersAddResponse) GetCreateCustomerResponse() *components.CreateCustomerResponse { - if o == nil { - return nil - } - return o.CreateCustomerResponse -} - -func (o *AccountingCustomersAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingcustomersall.go b/tests/mockserver/internal/sdk/models/operations/accountingcustomersall.go deleted file mode 100644 index 35441725..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingcustomersall.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingCustomersAllGlobals 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 *AccountingCustomersAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCustomersAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingCustomersAllRequest 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.CustomersFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // Apply sorting - Sort *components.CustomersSort `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 AccountingCustomersAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingCustomersAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingCustomersAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingCustomersAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCustomersAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingCustomersAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingCustomersAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AccountingCustomersAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *AccountingCustomersAllRequest) GetFilter() *components.CustomersFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *AccountingCustomersAllRequest) GetSort() *components.CustomersSort { - if o == nil { - return nil - } - return o.Sort -} - -func (o *AccountingCustomersAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *AccountingCustomersAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingCustomersAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Customers - GetCustomersResponse *components.GetCustomersResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AccountingCustomersAllResponse, error) -} - -func (o *AccountingCustomersAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingCustomersAllResponse) GetGetCustomersResponse() *components.GetCustomersResponse { - if o == nil { - return nil - } - return o.GetCustomersResponse -} - -func (o *AccountingCustomersAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingcustomersdelete.go b/tests/mockserver/internal/sdk/models/operations/accountingcustomersdelete.go deleted file mode 100644 index 1ad1cba3..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingcustomersdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingCustomersDeleteGlobals 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 *AccountingCustomersDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCustomersDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingCustomersDeleteRequest 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 AccountingCustomersDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingCustomersDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingCustomersDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingCustomersDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCustomersDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingCustomersDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingCustomersDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AccountingCustomersDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Customers - DeleteCustomerResponse *components.DeleteCustomerResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingCustomersDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingCustomersDeleteResponse) GetDeleteCustomerResponse() *components.DeleteCustomerResponse { - if o == nil { - return nil - } - return o.DeleteCustomerResponse -} - -func (o *AccountingCustomersDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingcustomersone.go b/tests/mockserver/internal/sdk/models/operations/accountingcustomersone.go deleted file mode 100644 index eecd3fb2..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingcustomersone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingCustomersOneGlobals 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 *AccountingCustomersOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCustomersOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingCustomersOneRequest 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 AccountingCustomersOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingCustomersOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingCustomersOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingCustomersOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCustomersOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingCustomersOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingCustomersOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingCustomersOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingCustomersOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Customer - GetCustomerResponse *components.GetCustomerResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingCustomersOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingCustomersOneResponse) GetGetCustomerResponse() *components.GetCustomerResponse { - if o == nil { - return nil - } - return o.GetCustomerResponse -} - -func (o *AccountingCustomersOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingcustomersupdate.go b/tests/mockserver/internal/sdk/models/operations/accountingcustomersupdate.go deleted file mode 100644 index cb0c1633..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingcustomersupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingCustomersUpdateGlobals 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 *AccountingCustomersUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCustomersUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingCustomersUpdateRequest 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"` - Customer components.CustomerInput `request:"mediaType=application/json"` -} - -func (a AccountingCustomersUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingCustomersUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingCustomersUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingCustomersUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingCustomersUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingCustomersUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingCustomersUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingCustomersUpdateRequest) GetCustomer() components.CustomerInput { - if o == nil { - return components.CustomerInput{} - } - return o.Customer -} - -type AccountingCustomersUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Customers - UpdateCustomerResponse *components.UpdateCustomerResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingCustomersUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingCustomersUpdateResponse) GetUpdateCustomerResponse() *components.UpdateCustomerResponse { - if o == nil { - return nil - } - return o.UpdateCustomerResponse -} - -func (o *AccountingCustomersUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingdepartmentsadd.go b/tests/mockserver/internal/sdk/models/operations/accountingdepartmentsadd.go deleted file mode 100644 index 75aa5ae2..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingdepartmentsadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingDepartmentsAddGlobals 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 *AccountingDepartmentsAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingDepartmentsAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingDepartmentsAddRequest 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"` - AccountingDepartment components.AccountingDepartmentInput `request:"mediaType=application/json"` -} - -func (a AccountingDepartmentsAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingDepartmentsAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingDepartmentsAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingDepartmentsAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingDepartmentsAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingDepartmentsAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingDepartmentsAddRequest) GetAccountingDepartment() components.AccountingDepartmentInput { - if o == nil { - return components.AccountingDepartmentInput{} - } - return o.AccountingDepartment -} - -type AccountingDepartmentsAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Department - CreateAccountingDepartmentResponse *components.CreateAccountingDepartmentResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingDepartmentsAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingDepartmentsAddResponse) GetCreateAccountingDepartmentResponse() *components.CreateAccountingDepartmentResponse { - if o == nil { - return nil - } - return o.CreateAccountingDepartmentResponse -} - -func (o *AccountingDepartmentsAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingdepartmentsall.go b/tests/mockserver/internal/sdk/models/operations/accountingdepartmentsall.go deleted file mode 100644 index b1319ec2..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingdepartmentsall.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingDepartmentsAllGlobals 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 *AccountingDepartmentsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingDepartmentsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingDepartmentsAllRequest 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"` - // 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"` - // Apply filters - Filter *components.AccountingDepartmentsFilter `queryParam:"style=deepObject,explode=true,name=filter"` -} - -func (a AccountingDepartmentsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingDepartmentsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingDepartmentsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingDepartmentsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingDepartmentsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingDepartmentsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingDepartmentsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AccountingDepartmentsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *AccountingDepartmentsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -func (o *AccountingDepartmentsAllRequest) GetFilter() *components.AccountingDepartmentsFilter { - if o == nil { - return nil - } - return o.Filter -} - -type AccountingDepartmentsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Departments - GetAccountingDepartmentsResponse *components.GetAccountingDepartmentsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AccountingDepartmentsAllResponse, error) -} - -func (o *AccountingDepartmentsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingDepartmentsAllResponse) GetGetAccountingDepartmentsResponse() *components.GetAccountingDepartmentsResponse { - if o == nil { - return nil - } - return o.GetAccountingDepartmentsResponse -} - -func (o *AccountingDepartmentsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingdepartmentsdelete.go b/tests/mockserver/internal/sdk/models/operations/accountingdepartmentsdelete.go deleted file mode 100644 index d0ddc46e..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingdepartmentsdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingDepartmentsDeleteGlobals 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 *AccountingDepartmentsDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingDepartmentsDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingDepartmentsDeleteRequest 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 AccountingDepartmentsDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingDepartmentsDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingDepartmentsDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingDepartmentsDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingDepartmentsDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingDepartmentsDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingDepartmentsDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AccountingDepartmentsDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Department deleted - DeleteAccountingDepartmentResponse *components.DeleteAccountingDepartmentResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingDepartmentsDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingDepartmentsDeleteResponse) GetDeleteAccountingDepartmentResponse() *components.DeleteAccountingDepartmentResponse { - if o == nil { - return nil - } - return o.DeleteAccountingDepartmentResponse -} - -func (o *AccountingDepartmentsDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingdepartmentsone.go b/tests/mockserver/internal/sdk/models/operations/accountingdepartmentsone.go deleted file mode 100644 index f3fd0f1d..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingdepartmentsone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingDepartmentsOneGlobals 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 *AccountingDepartmentsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingDepartmentsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingDepartmentsOneRequest 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 AccountingDepartmentsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingDepartmentsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingDepartmentsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingDepartmentsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingDepartmentsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingDepartmentsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingDepartmentsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingDepartmentsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingDepartmentsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Location - GetAccountingDepartmentResponse *components.GetAccountingDepartmentResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingDepartmentsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingDepartmentsOneResponse) GetGetAccountingDepartmentResponse() *components.GetAccountingDepartmentResponse { - if o == nil { - return nil - } - return o.GetAccountingDepartmentResponse -} - -func (o *AccountingDepartmentsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingdepartmentsupdate.go b/tests/mockserver/internal/sdk/models/operations/accountingdepartmentsupdate.go deleted file mode 100644 index 0d2fdfe7..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingdepartmentsupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingDepartmentsUpdateGlobals 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 *AccountingDepartmentsUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingDepartmentsUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingDepartmentsUpdateRequest 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"` - AccountingDepartment components.AccountingDepartmentInput `request:"mediaType=application/json"` -} - -func (a AccountingDepartmentsUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingDepartmentsUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingDepartmentsUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingDepartmentsUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingDepartmentsUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingDepartmentsUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingDepartmentsUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingDepartmentsUpdateRequest) GetAccountingDepartment() components.AccountingDepartmentInput { - if o == nil { - return components.AccountingDepartmentInput{} - } - return o.AccountingDepartment -} - -type AccountingDepartmentsUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Department - UpdateAccountingDepartmentResponse *components.UpdateAccountingDepartmentResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingDepartmentsUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingDepartmentsUpdateResponse) GetUpdateAccountingDepartmentResponse() *components.UpdateAccountingDepartmentResponse { - if o == nil { - return nil - } - return o.UpdateAccountingDepartmentResponse -} - -func (o *AccountingDepartmentsUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingexpensesadd.go b/tests/mockserver/internal/sdk/models/operations/accountingexpensesadd.go deleted file mode 100644 index 9c98b33e..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingexpensesadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingExpensesAddGlobals 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 *AccountingExpensesAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingExpensesAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingExpensesAddRequest 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"` - Expense components.ExpenseInput `request:"mediaType=application/json"` -} - -func (a AccountingExpensesAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingExpensesAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingExpensesAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingExpensesAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingExpensesAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingExpensesAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingExpensesAddRequest) GetExpense() components.ExpenseInput { - if o == nil { - return components.ExpenseInput{} - } - return o.Expense -} - -type AccountingExpensesAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Expenses - CreateExpenseResponse *components.CreateExpenseResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingExpensesAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingExpensesAddResponse) GetCreateExpenseResponse() *components.CreateExpenseResponse { - if o == nil { - return nil - } - return o.CreateExpenseResponse -} - -func (o *AccountingExpensesAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingexpensesall.go b/tests/mockserver/internal/sdk/models/operations/accountingexpensesall.go deleted file mode 100644 index 556c927d..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingexpensesall.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingExpensesAllGlobals 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 *AccountingExpensesAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingExpensesAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingExpensesAllRequest 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"` -} - -func (a AccountingExpensesAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingExpensesAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingExpensesAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingExpensesAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingExpensesAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingExpensesAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingExpensesAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AccountingExpensesAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -type AccountingExpensesAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Expenses - GetExpensesResponse *components.GetExpensesResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AccountingExpensesAllResponse, error) -} - -func (o *AccountingExpensesAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingExpensesAllResponse) GetGetExpensesResponse() *components.GetExpensesResponse { - if o == nil { - return nil - } - return o.GetExpensesResponse -} - -func (o *AccountingExpensesAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingexpensesdelete.go b/tests/mockserver/internal/sdk/models/operations/accountingexpensesdelete.go deleted file mode 100644 index 74ec2445..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingexpensesdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingExpensesDeleteGlobals 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 *AccountingExpensesDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingExpensesDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingExpensesDeleteRequest 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 AccountingExpensesDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingExpensesDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingExpensesDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingExpensesDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingExpensesDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingExpensesDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingExpensesDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AccountingExpensesDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Expenses - DeleteExpenseResponse *components.DeleteExpenseResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingExpensesDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingExpensesDeleteResponse) GetDeleteExpenseResponse() *components.DeleteExpenseResponse { - if o == nil { - return nil - } - return o.DeleteExpenseResponse -} - -func (o *AccountingExpensesDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingexpensesone.go b/tests/mockserver/internal/sdk/models/operations/accountingexpensesone.go deleted file mode 100644 index 16c821ac..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingexpensesone.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingExpensesOneGlobals 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 *AccountingExpensesOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingExpensesOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingExpensesOneRequest 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 AccountingExpensesOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingExpensesOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingExpensesOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingExpensesOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingExpensesOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingExpensesOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingExpensesOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AccountingExpensesOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Expenses - GetExpenseResponse *components.GetExpenseResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingExpensesOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingExpensesOneResponse) GetGetExpenseResponse() *components.GetExpenseResponse { - if o == nil { - return nil - } - return o.GetExpenseResponse -} - -func (o *AccountingExpensesOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingexpensesupdate.go b/tests/mockserver/internal/sdk/models/operations/accountingexpensesupdate.go deleted file mode 100644 index 231c5677..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingexpensesupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingExpensesUpdateGlobals 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 *AccountingExpensesUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingExpensesUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingExpensesUpdateRequest 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"` - Expense components.ExpenseInput `request:"mediaType=application/json"` -} - -func (a AccountingExpensesUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingExpensesUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingExpensesUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingExpensesUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingExpensesUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingExpensesUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingExpensesUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingExpensesUpdateRequest) GetExpense() components.ExpenseInput { - if o == nil { - return components.ExpenseInput{} - } - return o.Expense -} - -type AccountingExpensesUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Expenses - UpdateExpenseResponse *components.UpdateExpenseResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingExpensesUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingExpensesUpdateResponse) GetUpdateExpenseResponse() *components.UpdateExpenseResponse { - if o == nil { - return nil - } - return o.UpdateExpenseResponse -} - -func (o *AccountingExpensesUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountinginvoiceitemsadd.go b/tests/mockserver/internal/sdk/models/operations/accountinginvoiceitemsadd.go deleted file mode 100644 index c1634efd..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountinginvoiceitemsadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingInvoiceItemsAddGlobals 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 *AccountingInvoiceItemsAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingInvoiceItemsAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingInvoiceItemsAddRequest 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"` - InvoiceItem components.InvoiceItemInput `request:"mediaType=application/json"` -} - -func (a AccountingInvoiceItemsAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingInvoiceItemsAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingInvoiceItemsAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingInvoiceItemsAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingInvoiceItemsAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingInvoiceItemsAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingInvoiceItemsAddRequest) GetInvoiceItem() components.InvoiceItemInput { - if o == nil { - return components.InvoiceItemInput{} - } - return o.InvoiceItem -} - -type AccountingInvoiceItemsAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // InvoiceItems - CreateInvoiceItemResponse *components.CreateInvoiceItemResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingInvoiceItemsAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingInvoiceItemsAddResponse) GetCreateInvoiceItemResponse() *components.CreateInvoiceItemResponse { - if o == nil { - return nil - } - return o.CreateInvoiceItemResponse -} - -func (o *AccountingInvoiceItemsAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountinginvoiceitemsall.go b/tests/mockserver/internal/sdk/models/operations/accountinginvoiceitemsall.go deleted file mode 100644 index e015af31..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountinginvoiceitemsall.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingInvoiceItemsAllGlobals 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 *AccountingInvoiceItemsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingInvoiceItemsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingInvoiceItemsAllRequest 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.InvoiceItemsFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // Apply sorting - Sort *components.InvoiceItemsSort `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 AccountingInvoiceItemsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingInvoiceItemsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingInvoiceItemsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingInvoiceItemsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingInvoiceItemsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingInvoiceItemsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingInvoiceItemsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AccountingInvoiceItemsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *AccountingInvoiceItemsAllRequest) GetFilter() *components.InvoiceItemsFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *AccountingInvoiceItemsAllRequest) GetSort() *components.InvoiceItemsSort { - if o == nil { - return nil - } - return o.Sort -} - -func (o *AccountingInvoiceItemsAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *AccountingInvoiceItemsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingInvoiceItemsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // InvoiceItems - GetInvoiceItemsResponse *components.GetInvoiceItemsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AccountingInvoiceItemsAllResponse, error) -} - -func (o *AccountingInvoiceItemsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingInvoiceItemsAllResponse) GetGetInvoiceItemsResponse() *components.GetInvoiceItemsResponse { - if o == nil { - return nil - } - return o.GetInvoiceItemsResponse -} - -func (o *AccountingInvoiceItemsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountinginvoiceitemsdelete.go b/tests/mockserver/internal/sdk/models/operations/accountinginvoiceitemsdelete.go deleted file mode 100644 index aae9a473..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountinginvoiceitemsdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingInvoiceItemsDeleteGlobals 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 *AccountingInvoiceItemsDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingInvoiceItemsDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingInvoiceItemsDeleteRequest 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 AccountingInvoiceItemsDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingInvoiceItemsDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingInvoiceItemsDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingInvoiceItemsDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingInvoiceItemsDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingInvoiceItemsDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingInvoiceItemsDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AccountingInvoiceItemsDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // InvoiceItems - DeleteTaxRateResponse *components.DeleteTaxRateResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingInvoiceItemsDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingInvoiceItemsDeleteResponse) GetDeleteTaxRateResponse() *components.DeleteTaxRateResponse { - if o == nil { - return nil - } - return o.DeleteTaxRateResponse -} - -func (o *AccountingInvoiceItemsDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountinginvoiceitemsone.go b/tests/mockserver/internal/sdk/models/operations/accountinginvoiceitemsone.go deleted file mode 100644 index da9033a9..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountinginvoiceitemsone.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingInvoiceItemsOneGlobals 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 *AccountingInvoiceItemsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingInvoiceItemsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingInvoiceItemsOneRequest 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"` - // Apply filters - Filter *components.InvoiceItemFilter `queryParam:"style=deepObject,explode=true,name=filter"` -} - -func (a AccountingInvoiceItemsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingInvoiceItemsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingInvoiceItemsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingInvoiceItemsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingInvoiceItemsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingInvoiceItemsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingInvoiceItemsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingInvoiceItemsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -func (o *AccountingInvoiceItemsOneRequest) GetFilter() *components.InvoiceItemFilter { - if o == nil { - return nil - } - return o.Filter -} - -type AccountingInvoiceItemsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // InvoiceItems - GetInvoiceItemResponse *components.GetInvoiceItemResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingInvoiceItemsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingInvoiceItemsOneResponse) GetGetInvoiceItemResponse() *components.GetInvoiceItemResponse { - if o == nil { - return nil - } - return o.GetInvoiceItemResponse -} - -func (o *AccountingInvoiceItemsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountinginvoiceitemsupdate.go b/tests/mockserver/internal/sdk/models/operations/accountinginvoiceitemsupdate.go deleted file mode 100644 index c9a35403..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountinginvoiceitemsupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingInvoiceItemsUpdateGlobals 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 *AccountingInvoiceItemsUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingInvoiceItemsUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingInvoiceItemsUpdateRequest 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"` - InvoiceItem components.InvoiceItemInput `request:"mediaType=application/json"` -} - -func (a AccountingInvoiceItemsUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingInvoiceItemsUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingInvoiceItemsUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingInvoiceItemsUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingInvoiceItemsUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingInvoiceItemsUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingInvoiceItemsUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingInvoiceItemsUpdateRequest) GetInvoiceItem() components.InvoiceItemInput { - if o == nil { - return components.InvoiceItemInput{} - } - return o.InvoiceItem -} - -type AccountingInvoiceItemsUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // InvoiceItems - UpdateInvoiceItemsResponse *components.UpdateInvoiceItemsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingInvoiceItemsUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingInvoiceItemsUpdateResponse) GetUpdateInvoiceItemsResponse() *components.UpdateInvoiceItemsResponse { - if o == nil { - return nil - } - return o.UpdateInvoiceItemsResponse -} - -func (o *AccountingInvoiceItemsUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountinginvoicesadd.go b/tests/mockserver/internal/sdk/models/operations/accountinginvoicesadd.go deleted file mode 100644 index 9a08ec99..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountinginvoicesadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingInvoicesAddGlobals 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 *AccountingInvoicesAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingInvoicesAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingInvoicesAddRequest 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"` - Invoice components.InvoiceInput `request:"mediaType=application/json"` -} - -func (a AccountingInvoicesAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingInvoicesAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingInvoicesAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingInvoicesAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingInvoicesAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingInvoicesAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingInvoicesAddRequest) GetInvoice() components.InvoiceInput { - if o == nil { - return components.InvoiceInput{} - } - return o.Invoice -} - -type AccountingInvoicesAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Invoice created - CreateInvoiceResponse *components.CreateInvoiceResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingInvoicesAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingInvoicesAddResponse) GetCreateInvoiceResponse() *components.CreateInvoiceResponse { - if o == nil { - return nil - } - return o.CreateInvoiceResponse -} - -func (o *AccountingInvoicesAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountinginvoicesall.go b/tests/mockserver/internal/sdk/models/operations/accountinginvoicesall.go deleted file mode 100644 index de7c4836..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountinginvoicesall.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingInvoicesAllGlobals 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 *AccountingInvoicesAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingInvoicesAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingInvoicesAllRequest 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.InvoicesFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // Apply sorting - Sort *components.InvoicesSort `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 AccountingInvoicesAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingInvoicesAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingInvoicesAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingInvoicesAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingInvoicesAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingInvoicesAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingInvoicesAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AccountingInvoicesAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *AccountingInvoicesAllRequest) GetFilter() *components.InvoicesFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *AccountingInvoicesAllRequest) GetSort() *components.InvoicesSort { - if o == nil { - return nil - } - return o.Sort -} - -func (o *AccountingInvoicesAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *AccountingInvoicesAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingInvoicesAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Invoices - GetInvoicesResponse *components.GetInvoicesResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AccountingInvoicesAllResponse, error) -} - -func (o *AccountingInvoicesAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingInvoicesAllResponse) GetGetInvoicesResponse() *components.GetInvoicesResponse { - if o == nil { - return nil - } - return o.GetInvoicesResponse -} - -func (o *AccountingInvoicesAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountinginvoicesdelete.go b/tests/mockserver/internal/sdk/models/operations/accountinginvoicesdelete.go deleted file mode 100644 index c8974dd2..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountinginvoicesdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingInvoicesDeleteGlobals 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 *AccountingInvoicesDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingInvoicesDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingInvoicesDeleteRequest 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 AccountingInvoicesDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingInvoicesDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingInvoicesDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingInvoicesDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingInvoicesDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingInvoicesDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingInvoicesDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AccountingInvoicesDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Invoice deleted - DeleteInvoiceResponse *components.DeleteInvoiceResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingInvoicesDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingInvoicesDeleteResponse) GetDeleteInvoiceResponse() *components.DeleteInvoiceResponse { - if o == nil { - return nil - } - return o.DeleteInvoiceResponse -} - -func (o *AccountingInvoicesDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountinginvoicesone.go b/tests/mockserver/internal/sdk/models/operations/accountinginvoicesone.go deleted file mode 100644 index e375c1b7..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountinginvoicesone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingInvoicesOneGlobals 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 *AccountingInvoicesOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingInvoicesOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingInvoicesOneRequest 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 AccountingInvoicesOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingInvoicesOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingInvoicesOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingInvoicesOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingInvoicesOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingInvoicesOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingInvoicesOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingInvoicesOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingInvoicesOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Invoice - GetInvoiceResponse *components.GetInvoiceResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingInvoicesOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingInvoicesOneResponse) GetGetInvoiceResponse() *components.GetInvoiceResponse { - if o == nil { - return nil - } - return o.GetInvoiceResponse -} - -func (o *AccountingInvoicesOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountinginvoicesupdate.go b/tests/mockserver/internal/sdk/models/operations/accountinginvoicesupdate.go deleted file mode 100644 index 230ebf42..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountinginvoicesupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingInvoicesUpdateGlobals 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 *AccountingInvoicesUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingInvoicesUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingInvoicesUpdateRequest 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"` - Invoice components.InvoiceInput `request:"mediaType=application/json"` -} - -func (a AccountingInvoicesUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingInvoicesUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingInvoicesUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingInvoicesUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingInvoicesUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingInvoicesUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingInvoicesUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingInvoicesUpdateRequest) GetInvoice() components.InvoiceInput { - if o == nil { - return components.InvoiceInput{} - } - return o.Invoice -} - -type AccountingInvoicesUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Invoice updated - UpdateInvoiceResponse *components.UpdateInvoiceResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingInvoicesUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingInvoicesUpdateResponse) GetUpdateInvoiceResponse() *components.UpdateInvoiceResponse { - if o == nil { - return nil - } - return o.UpdateInvoiceResponse -} - -func (o *AccountingInvoicesUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingjournalentriesadd.go b/tests/mockserver/internal/sdk/models/operations/accountingjournalentriesadd.go deleted file mode 100644 index d53ff977..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingjournalentriesadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingJournalEntriesAddGlobals 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 *AccountingJournalEntriesAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingJournalEntriesAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingJournalEntriesAddRequest 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"` - JournalEntry components.JournalEntryInput `request:"mediaType=application/json"` -} - -func (a AccountingJournalEntriesAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingJournalEntriesAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingJournalEntriesAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingJournalEntriesAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingJournalEntriesAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingJournalEntriesAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingJournalEntriesAddRequest) GetJournalEntry() components.JournalEntryInput { - if o == nil { - return components.JournalEntryInput{} - } - return o.JournalEntry -} - -type AccountingJournalEntriesAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // JournalEntries - CreateJournalEntryResponse *components.CreateJournalEntryResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingJournalEntriesAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingJournalEntriesAddResponse) GetCreateJournalEntryResponse() *components.CreateJournalEntryResponse { - if o == nil { - return nil - } - return o.CreateJournalEntryResponse -} - -func (o *AccountingJournalEntriesAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingjournalentriesall.go b/tests/mockserver/internal/sdk/models/operations/accountingjournalentriesall.go deleted file mode 100644 index f9e8c5bb..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingjournalentriesall.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingJournalEntriesAllGlobals 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 *AccountingJournalEntriesAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingJournalEntriesAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingJournalEntriesAllRequest 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.JournalEntriesFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // Apply sorting - Sort *components.JournalEntriesSort `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 AccountingJournalEntriesAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingJournalEntriesAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingJournalEntriesAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingJournalEntriesAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingJournalEntriesAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingJournalEntriesAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingJournalEntriesAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AccountingJournalEntriesAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *AccountingJournalEntriesAllRequest) GetFilter() *components.JournalEntriesFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *AccountingJournalEntriesAllRequest) GetSort() *components.JournalEntriesSort { - if o == nil { - return nil - } - return o.Sort -} - -func (o *AccountingJournalEntriesAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *AccountingJournalEntriesAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingJournalEntriesAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // JournalEntry - GetJournalEntriesResponse *components.GetJournalEntriesResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AccountingJournalEntriesAllResponse, error) -} - -func (o *AccountingJournalEntriesAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingJournalEntriesAllResponse) GetGetJournalEntriesResponse() *components.GetJournalEntriesResponse { - if o == nil { - return nil - } - return o.GetJournalEntriesResponse -} - -func (o *AccountingJournalEntriesAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingjournalentriesdelete.go b/tests/mockserver/internal/sdk/models/operations/accountingjournalentriesdelete.go deleted file mode 100644 index 2c6a5a99..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingjournalentriesdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingJournalEntriesDeleteGlobals 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 *AccountingJournalEntriesDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingJournalEntriesDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingJournalEntriesDeleteRequest 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 AccountingJournalEntriesDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingJournalEntriesDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingJournalEntriesDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingJournalEntriesDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingJournalEntriesDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingJournalEntriesDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingJournalEntriesDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AccountingJournalEntriesDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // JournalEntries - DeleteJournalEntryResponse *components.DeleteJournalEntryResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingJournalEntriesDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingJournalEntriesDeleteResponse) GetDeleteJournalEntryResponse() *components.DeleteJournalEntryResponse { - if o == nil { - return nil - } - return o.DeleteJournalEntryResponse -} - -func (o *AccountingJournalEntriesDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingjournalentriesone.go b/tests/mockserver/internal/sdk/models/operations/accountingjournalentriesone.go deleted file mode 100644 index eda8c2f9..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingjournalentriesone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingJournalEntriesOneGlobals 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 *AccountingJournalEntriesOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingJournalEntriesOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingJournalEntriesOneRequest 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 AccountingJournalEntriesOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingJournalEntriesOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingJournalEntriesOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingJournalEntriesOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingJournalEntriesOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingJournalEntriesOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingJournalEntriesOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingJournalEntriesOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingJournalEntriesOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // JournalEntries - GetJournalEntryResponse *components.GetJournalEntryResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingJournalEntriesOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingJournalEntriesOneResponse) GetGetJournalEntryResponse() *components.GetJournalEntryResponse { - if o == nil { - return nil - } - return o.GetJournalEntryResponse -} - -func (o *AccountingJournalEntriesOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingjournalentriesupdate.go b/tests/mockserver/internal/sdk/models/operations/accountingjournalentriesupdate.go deleted file mode 100644 index 62740b05..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingjournalentriesupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingJournalEntriesUpdateGlobals 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 *AccountingJournalEntriesUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingJournalEntriesUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingJournalEntriesUpdateRequest 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"` - JournalEntry components.JournalEntryInput `request:"mediaType=application/json"` -} - -func (a AccountingJournalEntriesUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingJournalEntriesUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingJournalEntriesUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingJournalEntriesUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingJournalEntriesUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingJournalEntriesUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingJournalEntriesUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingJournalEntriesUpdateRequest) GetJournalEntry() components.JournalEntryInput { - if o == nil { - return components.JournalEntryInput{} - } - return o.JournalEntry -} - -type AccountingJournalEntriesUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // JournalEntries - UpdateJournalEntryResponse *components.UpdateJournalEntryResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingJournalEntriesUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingJournalEntriesUpdateResponse) GetUpdateJournalEntryResponse() *components.UpdateJournalEntryResponse { - if o == nil { - return nil - } - return o.UpdateJournalEntryResponse -} - -func (o *AccountingJournalEntriesUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingledgeraccountsadd.go b/tests/mockserver/internal/sdk/models/operations/accountingledgeraccountsadd.go deleted file mode 100644 index 9ca6a242..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingledgeraccountsadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingLedgerAccountsAddGlobals 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 *AccountingLedgerAccountsAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingLedgerAccountsAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingLedgerAccountsAddRequest 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"` - LedgerAccount components.LedgerAccountInput `request:"mediaType=application/json"` -} - -func (a AccountingLedgerAccountsAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingLedgerAccountsAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingLedgerAccountsAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingLedgerAccountsAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingLedgerAccountsAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingLedgerAccountsAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingLedgerAccountsAddRequest) GetLedgerAccount() components.LedgerAccountInput { - if o == nil { - return components.LedgerAccountInput{} - } - return o.LedgerAccount -} - -type AccountingLedgerAccountsAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // LedgerAccount created - CreateLedgerAccountResponse *components.CreateLedgerAccountResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingLedgerAccountsAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingLedgerAccountsAddResponse) GetCreateLedgerAccountResponse() *components.CreateLedgerAccountResponse { - if o == nil { - return nil - } - return o.CreateLedgerAccountResponse -} - -func (o *AccountingLedgerAccountsAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingledgeraccountsall.go b/tests/mockserver/internal/sdk/models/operations/accountingledgeraccountsall.go deleted file mode 100644 index 4cd9dd2e..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingledgeraccountsall.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingLedgerAccountsAllGlobals 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 *AccountingLedgerAccountsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingLedgerAccountsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingLedgerAccountsAllRequest 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.LedgerAccountsFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // Apply sorting - Sort *components.LedgerAccountsSort `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 AccountingLedgerAccountsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingLedgerAccountsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingLedgerAccountsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingLedgerAccountsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingLedgerAccountsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingLedgerAccountsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingLedgerAccountsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AccountingLedgerAccountsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *AccountingLedgerAccountsAllRequest) GetFilter() *components.LedgerAccountsFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *AccountingLedgerAccountsAllRequest) GetSort() *components.LedgerAccountsSort { - if o == nil { - return nil - } - return o.Sort -} - -func (o *AccountingLedgerAccountsAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *AccountingLedgerAccountsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingLedgerAccountsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // LedgerAccounts - GetLedgerAccountsResponse *components.GetLedgerAccountsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AccountingLedgerAccountsAllResponse, error) -} - -func (o *AccountingLedgerAccountsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingLedgerAccountsAllResponse) GetGetLedgerAccountsResponse() *components.GetLedgerAccountsResponse { - if o == nil { - return nil - } - return o.GetLedgerAccountsResponse -} - -func (o *AccountingLedgerAccountsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingledgeraccountsdelete.go b/tests/mockserver/internal/sdk/models/operations/accountingledgeraccountsdelete.go deleted file mode 100644 index 0331046d..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingledgeraccountsdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingLedgerAccountsDeleteGlobals 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 *AccountingLedgerAccountsDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingLedgerAccountsDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingLedgerAccountsDeleteRequest 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 AccountingLedgerAccountsDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingLedgerAccountsDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingLedgerAccountsDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingLedgerAccountsDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingLedgerAccountsDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingLedgerAccountsDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingLedgerAccountsDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AccountingLedgerAccountsDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // LedgerAccount deleted - DeleteLedgerAccountResponse *components.DeleteLedgerAccountResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingLedgerAccountsDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingLedgerAccountsDeleteResponse) GetDeleteLedgerAccountResponse() *components.DeleteLedgerAccountResponse { - if o == nil { - return nil - } - return o.DeleteLedgerAccountResponse -} - -func (o *AccountingLedgerAccountsDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingledgeraccountsone.go b/tests/mockserver/internal/sdk/models/operations/accountingledgeraccountsone.go deleted file mode 100644 index a0128aef..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingledgeraccountsone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingLedgerAccountsOneGlobals 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 *AccountingLedgerAccountsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingLedgerAccountsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingLedgerAccountsOneRequest 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 AccountingLedgerAccountsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingLedgerAccountsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingLedgerAccountsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingLedgerAccountsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingLedgerAccountsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingLedgerAccountsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingLedgerAccountsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingLedgerAccountsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingLedgerAccountsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // LedgerAccount - GetLedgerAccountResponse *components.GetLedgerAccountResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingLedgerAccountsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingLedgerAccountsOneResponse) GetGetLedgerAccountResponse() *components.GetLedgerAccountResponse { - if o == nil { - return nil - } - return o.GetLedgerAccountResponse -} - -func (o *AccountingLedgerAccountsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingledgeraccountsupdate.go b/tests/mockserver/internal/sdk/models/operations/accountingledgeraccountsupdate.go deleted file mode 100644 index 6110a8b2..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingledgeraccountsupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingLedgerAccountsUpdateGlobals 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 *AccountingLedgerAccountsUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingLedgerAccountsUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingLedgerAccountsUpdateRequest 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"` - LedgerAccount components.LedgerAccountInput `request:"mediaType=application/json"` -} - -func (a AccountingLedgerAccountsUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingLedgerAccountsUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingLedgerAccountsUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingLedgerAccountsUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingLedgerAccountsUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingLedgerAccountsUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingLedgerAccountsUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingLedgerAccountsUpdateRequest) GetLedgerAccount() components.LedgerAccountInput { - if o == nil { - return components.LedgerAccountInput{} - } - return o.LedgerAccount -} - -type AccountingLedgerAccountsUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // LedgerAccount updated - UpdateLedgerAccountResponse *components.UpdateLedgerAccountResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingLedgerAccountsUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingLedgerAccountsUpdateResponse) GetUpdateLedgerAccountResponse() *components.UpdateLedgerAccountResponse { - if o == nil { - return nil - } - return o.UpdateLedgerAccountResponse -} - -func (o *AccountingLedgerAccountsUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountinglocationsadd.go b/tests/mockserver/internal/sdk/models/operations/accountinglocationsadd.go deleted file mode 100644 index b8b495f6..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountinglocationsadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingLocationsAddGlobals 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 *AccountingLocationsAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingLocationsAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingLocationsAddRequest 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"` - AccountingLocation components.AccountingLocationInput `request:"mediaType=application/json"` -} - -func (a AccountingLocationsAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingLocationsAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingLocationsAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingLocationsAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingLocationsAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingLocationsAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingLocationsAddRequest) GetAccountingLocation() components.AccountingLocationInput { - if o == nil { - return components.AccountingLocationInput{} - } - return o.AccountingLocation -} - -type AccountingLocationsAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Location - CreateAccountingLocationResponse *components.CreateAccountingLocationResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingLocationsAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingLocationsAddResponse) GetCreateAccountingLocationResponse() *components.CreateAccountingLocationResponse { - if o == nil { - return nil - } - return o.CreateAccountingLocationResponse -} - -func (o *AccountingLocationsAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountinglocationsall.go b/tests/mockserver/internal/sdk/models/operations/accountinglocationsall.go deleted file mode 100644 index c79b965a..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountinglocationsall.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingLocationsAllGlobals 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 *AccountingLocationsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingLocationsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingLocationsAllRequest 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"` - // 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"` - // Apply filters - Filter *components.AccountingLocationsFilter `queryParam:"style=deepObject,explode=true,name=filter"` -} - -func (a AccountingLocationsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingLocationsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingLocationsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingLocationsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingLocationsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingLocationsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingLocationsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AccountingLocationsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *AccountingLocationsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -func (o *AccountingLocationsAllRequest) GetFilter() *components.AccountingLocationsFilter { - if o == nil { - return nil - } - return o.Filter -} - -type AccountingLocationsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Locations - GetAccountingLocationsResponse *components.GetAccountingLocationsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AccountingLocationsAllResponse, error) -} - -func (o *AccountingLocationsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingLocationsAllResponse) GetGetAccountingLocationsResponse() *components.GetAccountingLocationsResponse { - if o == nil { - return nil - } - return o.GetAccountingLocationsResponse -} - -func (o *AccountingLocationsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountinglocationsdelete.go b/tests/mockserver/internal/sdk/models/operations/accountinglocationsdelete.go deleted file mode 100644 index 5d1029ed..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountinglocationsdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingLocationsDeleteGlobals 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 *AccountingLocationsDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingLocationsDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingLocationsDeleteRequest 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 AccountingLocationsDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingLocationsDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingLocationsDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingLocationsDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingLocationsDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingLocationsDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingLocationsDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AccountingLocationsDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Location deleted - DeleteAccountingLocationResponse *components.DeleteAccountingLocationResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingLocationsDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingLocationsDeleteResponse) GetDeleteAccountingLocationResponse() *components.DeleteAccountingLocationResponse { - if o == nil { - return nil - } - return o.DeleteAccountingLocationResponse -} - -func (o *AccountingLocationsDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountinglocationsone.go b/tests/mockserver/internal/sdk/models/operations/accountinglocationsone.go deleted file mode 100644 index d4948ed5..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountinglocationsone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingLocationsOneGlobals 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 *AccountingLocationsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingLocationsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingLocationsOneRequest 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 AccountingLocationsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingLocationsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingLocationsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingLocationsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingLocationsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingLocationsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingLocationsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingLocationsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingLocationsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Location - GetAccountingLocationResponse *components.GetAccountingLocationResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingLocationsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingLocationsOneResponse) GetGetAccountingLocationResponse() *components.GetAccountingLocationResponse { - if o == nil { - return nil - } - return o.GetAccountingLocationResponse -} - -func (o *AccountingLocationsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountinglocationsupdate.go b/tests/mockserver/internal/sdk/models/operations/accountinglocationsupdate.go deleted file mode 100644 index 2713f4e5..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountinglocationsupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingLocationsUpdateGlobals 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 *AccountingLocationsUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingLocationsUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingLocationsUpdateRequest 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"` - AccountingLocation components.AccountingLocationInput `request:"mediaType=application/json"` -} - -func (a AccountingLocationsUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingLocationsUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingLocationsUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingLocationsUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingLocationsUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingLocationsUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingLocationsUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingLocationsUpdateRequest) GetAccountingLocation() components.AccountingLocationInput { - if o == nil { - return components.AccountingLocationInput{} - } - return o.AccountingLocation -} - -type AccountingLocationsUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Location - UpdateAccountingLocationResponse *components.UpdateAccountingLocationResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingLocationsUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingLocationsUpdateResponse) GetUpdateAccountingLocationResponse() *components.UpdateAccountingLocationResponse { - if o == nil { - return nil - } - return o.UpdateAccountingLocationResponse -} - -func (o *AccountingLocationsUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingpaymentsadd.go b/tests/mockserver/internal/sdk/models/operations/accountingpaymentsadd.go deleted file mode 100644 index 6f22416a..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingpaymentsadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingPaymentsAddGlobals 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 *AccountingPaymentsAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingPaymentsAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingPaymentsAddRequest 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"` - Payment components.PaymentInput `request:"mediaType=application/json"` -} - -func (a AccountingPaymentsAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingPaymentsAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingPaymentsAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingPaymentsAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingPaymentsAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingPaymentsAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingPaymentsAddRequest) GetPayment() components.PaymentInput { - if o == nil { - return components.PaymentInput{} - } - return o.Payment -} - -type AccountingPaymentsAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Payment created - CreatePaymentResponse *components.CreatePaymentResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingPaymentsAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingPaymentsAddResponse) GetCreatePaymentResponse() *components.CreatePaymentResponse { - if o == nil { - return nil - } - return o.CreatePaymentResponse -} - -func (o *AccountingPaymentsAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingpaymentsall.go b/tests/mockserver/internal/sdk/models/operations/accountingpaymentsall.go deleted file mode 100644 index 40d64416..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingpaymentsall.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingPaymentsAllGlobals 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 *AccountingPaymentsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingPaymentsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingPaymentsAllRequest 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.PaymentsFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // Apply sorting - Sort *components.PaymentsSort `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 AccountingPaymentsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingPaymentsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingPaymentsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingPaymentsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingPaymentsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingPaymentsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingPaymentsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AccountingPaymentsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *AccountingPaymentsAllRequest) GetFilter() *components.PaymentsFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *AccountingPaymentsAllRequest) GetSort() *components.PaymentsSort { - if o == nil { - return nil - } - return o.Sort -} - -func (o *AccountingPaymentsAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *AccountingPaymentsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingPaymentsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Payments - GetPaymentsResponse *components.GetPaymentsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AccountingPaymentsAllResponse, error) -} - -func (o *AccountingPaymentsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingPaymentsAllResponse) GetGetPaymentsResponse() *components.GetPaymentsResponse { - if o == nil { - return nil - } - return o.GetPaymentsResponse -} - -func (o *AccountingPaymentsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingpaymentsdelete.go b/tests/mockserver/internal/sdk/models/operations/accountingpaymentsdelete.go deleted file mode 100644 index 8258006d..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingpaymentsdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingPaymentsDeleteGlobals 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 *AccountingPaymentsDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingPaymentsDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingPaymentsDeleteRequest 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 AccountingPaymentsDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingPaymentsDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingPaymentsDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingPaymentsDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingPaymentsDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingPaymentsDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingPaymentsDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AccountingPaymentsDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Payment deleted - DeletePaymentResponse *components.DeletePaymentResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingPaymentsDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingPaymentsDeleteResponse) GetDeletePaymentResponse() *components.DeletePaymentResponse { - if o == nil { - return nil - } - return o.DeletePaymentResponse -} - -func (o *AccountingPaymentsDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingpaymentsone.go b/tests/mockserver/internal/sdk/models/operations/accountingpaymentsone.go deleted file mode 100644 index a978e976..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingpaymentsone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingPaymentsOneGlobals 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 *AccountingPaymentsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingPaymentsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingPaymentsOneRequest 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 AccountingPaymentsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingPaymentsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingPaymentsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingPaymentsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingPaymentsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingPaymentsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingPaymentsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingPaymentsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingPaymentsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Payment - GetPaymentResponse *components.GetPaymentResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingPaymentsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingPaymentsOneResponse) GetGetPaymentResponse() *components.GetPaymentResponse { - if o == nil { - return nil - } - return o.GetPaymentResponse -} - -func (o *AccountingPaymentsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingpaymentsupdate.go b/tests/mockserver/internal/sdk/models/operations/accountingpaymentsupdate.go deleted file mode 100644 index 06d3ad1c..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingpaymentsupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingPaymentsUpdateGlobals 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 *AccountingPaymentsUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingPaymentsUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingPaymentsUpdateRequest 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"` - Payment components.PaymentInput `request:"mediaType=application/json"` -} - -func (a AccountingPaymentsUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingPaymentsUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingPaymentsUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingPaymentsUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingPaymentsUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingPaymentsUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingPaymentsUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingPaymentsUpdateRequest) GetPayment() components.PaymentInput { - if o == nil { - return components.PaymentInput{} - } - return o.Payment -} - -type AccountingPaymentsUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Payment Updated - UpdatePaymentResponse *components.UpdatePaymentResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingPaymentsUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingPaymentsUpdateResponse) GetUpdatePaymentResponse() *components.UpdatePaymentResponse { - if o == nil { - return nil - } - return o.UpdatePaymentResponse -} - -func (o *AccountingPaymentsUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingprofitandlossone.go b/tests/mockserver/internal/sdk/models/operations/accountingprofitandlossone.go deleted file mode 100644 index 6fabd234..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingprofitandlossone.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingProfitAndLossOneGlobals 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 *AccountingProfitAndLossOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingProfitAndLossOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingProfitAndLossOneRequest 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"` - // Apply filters - Filter *components.ProfitAndLossFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // 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 AccountingProfitAndLossOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingProfitAndLossOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingProfitAndLossOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingProfitAndLossOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingProfitAndLossOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingProfitAndLossOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingProfitAndLossOneRequest) GetFilter() *components.ProfitAndLossFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *AccountingProfitAndLossOneRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *AccountingProfitAndLossOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingProfitAndLossOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Profit & Loss Report - GetProfitAndLossResponse *components.GetProfitAndLossResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingProfitAndLossOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingProfitAndLossOneResponse) GetGetProfitAndLossResponse() *components.GetProfitAndLossResponse { - if o == nil { - return nil - } - return o.GetProfitAndLossResponse -} - -func (o *AccountingProfitAndLossOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingpurchaseordersadd.go b/tests/mockserver/internal/sdk/models/operations/accountingpurchaseordersadd.go deleted file mode 100644 index 88895df1..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingpurchaseordersadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingPurchaseOrdersAddGlobals 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 *AccountingPurchaseOrdersAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingPurchaseOrdersAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingPurchaseOrdersAddRequest 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"` - PurchaseOrder components.PurchaseOrderInput `request:"mediaType=application/json"` -} - -func (a AccountingPurchaseOrdersAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingPurchaseOrdersAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingPurchaseOrdersAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingPurchaseOrdersAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingPurchaseOrdersAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingPurchaseOrdersAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingPurchaseOrdersAddRequest) GetPurchaseOrder() components.PurchaseOrderInput { - if o == nil { - return components.PurchaseOrderInput{} - } - return o.PurchaseOrder -} - -type AccountingPurchaseOrdersAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // PurchaseOrders - CreatePurchaseOrderResponse *components.CreatePurchaseOrderResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingPurchaseOrdersAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingPurchaseOrdersAddResponse) GetCreatePurchaseOrderResponse() *components.CreatePurchaseOrderResponse { - if o == nil { - return nil - } - return o.CreatePurchaseOrderResponse -} - -func (o *AccountingPurchaseOrdersAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingpurchaseordersall.go b/tests/mockserver/internal/sdk/models/operations/accountingpurchaseordersall.go deleted file mode 100644 index 82144202..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingpurchaseordersall.go +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingPurchaseOrdersAllGlobals 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 *AccountingPurchaseOrdersAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingPurchaseOrdersAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingPurchaseOrdersAllRequest 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"` - // 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"` - // 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.PurchaseOrdersFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // Apply sorting - Sort *components.PurchaseOrdersSort `queryParam:"style=deepObject,explode=true,name=sort"` -} - -func (a AccountingPurchaseOrdersAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingPurchaseOrdersAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingPurchaseOrdersAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingPurchaseOrdersAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingPurchaseOrdersAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingPurchaseOrdersAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingPurchaseOrdersAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AccountingPurchaseOrdersAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *AccountingPurchaseOrdersAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *AccountingPurchaseOrdersAllRequest) GetFilter() *components.PurchaseOrdersFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *AccountingPurchaseOrdersAllRequest) GetSort() *components.PurchaseOrdersSort { - if o == nil { - return nil - } - return o.Sort -} - -type AccountingPurchaseOrdersAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // PurchaseOrders - GetPurchaseOrdersResponse *components.GetPurchaseOrdersResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AccountingPurchaseOrdersAllResponse, error) -} - -func (o *AccountingPurchaseOrdersAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingPurchaseOrdersAllResponse) GetGetPurchaseOrdersResponse() *components.GetPurchaseOrdersResponse { - if o == nil { - return nil - } - return o.GetPurchaseOrdersResponse -} - -func (o *AccountingPurchaseOrdersAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingpurchaseordersdelete.go b/tests/mockserver/internal/sdk/models/operations/accountingpurchaseordersdelete.go deleted file mode 100644 index 18338dbc..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingpurchaseordersdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingPurchaseOrdersDeleteGlobals 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 *AccountingPurchaseOrdersDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingPurchaseOrdersDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingPurchaseOrdersDeleteRequest 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 AccountingPurchaseOrdersDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingPurchaseOrdersDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingPurchaseOrdersDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingPurchaseOrdersDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingPurchaseOrdersDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingPurchaseOrdersDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingPurchaseOrdersDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AccountingPurchaseOrdersDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // PurchaseOrders - DeletePurchaseOrderResponse *components.DeletePurchaseOrderResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingPurchaseOrdersDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingPurchaseOrdersDeleteResponse) GetDeletePurchaseOrderResponse() *components.DeletePurchaseOrderResponse { - if o == nil { - return nil - } - return o.DeletePurchaseOrderResponse -} - -func (o *AccountingPurchaseOrdersDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingpurchaseordersone.go b/tests/mockserver/internal/sdk/models/operations/accountingpurchaseordersone.go deleted file mode 100644 index 9a945d70..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingpurchaseordersone.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingPurchaseOrdersOneGlobals 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 *AccountingPurchaseOrdersOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingPurchaseOrdersOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingPurchaseOrdersOneRequest 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 AccountingPurchaseOrdersOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingPurchaseOrdersOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingPurchaseOrdersOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingPurchaseOrdersOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingPurchaseOrdersOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingPurchaseOrdersOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingPurchaseOrdersOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AccountingPurchaseOrdersOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // PurchaseOrders - GetPurchaseOrderResponse *components.GetPurchaseOrderResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingPurchaseOrdersOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingPurchaseOrdersOneResponse) GetGetPurchaseOrderResponse() *components.GetPurchaseOrderResponse { - if o == nil { - return nil - } - return o.GetPurchaseOrderResponse -} - -func (o *AccountingPurchaseOrdersOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingpurchaseordersupdate.go b/tests/mockserver/internal/sdk/models/operations/accountingpurchaseordersupdate.go deleted file mode 100644 index 6b6eb353..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingpurchaseordersupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingPurchaseOrdersUpdateGlobals 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 *AccountingPurchaseOrdersUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingPurchaseOrdersUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingPurchaseOrdersUpdateRequest 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"` - PurchaseOrder components.PurchaseOrderInput `request:"mediaType=application/json"` -} - -func (a AccountingPurchaseOrdersUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingPurchaseOrdersUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingPurchaseOrdersUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingPurchaseOrdersUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingPurchaseOrdersUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingPurchaseOrdersUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingPurchaseOrdersUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingPurchaseOrdersUpdateRequest) GetPurchaseOrder() components.PurchaseOrderInput { - if o == nil { - return components.PurchaseOrderInput{} - } - return o.PurchaseOrder -} - -type AccountingPurchaseOrdersUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // PurchaseOrders - UpdatePurchaseOrderResponse *components.UpdatePurchaseOrderResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingPurchaseOrdersUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingPurchaseOrdersUpdateResponse) GetUpdatePurchaseOrderResponse() *components.UpdatePurchaseOrderResponse { - if o == nil { - return nil - } - return o.UpdatePurchaseOrderResponse -} - -func (o *AccountingPurchaseOrdersUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingsubsidiariesadd.go b/tests/mockserver/internal/sdk/models/operations/accountingsubsidiariesadd.go deleted file mode 100644 index cbd0a5d8..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingsubsidiariesadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingSubsidiariesAddGlobals 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 *AccountingSubsidiariesAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingSubsidiariesAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingSubsidiariesAddRequest 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"` - Subsidiary components.SubsidiaryInput `request:"mediaType=application/json"` -} - -func (a AccountingSubsidiariesAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingSubsidiariesAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingSubsidiariesAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingSubsidiariesAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingSubsidiariesAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingSubsidiariesAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingSubsidiariesAddRequest) GetSubsidiary() components.SubsidiaryInput { - if o == nil { - return components.SubsidiaryInput{} - } - return o.Subsidiary -} - -type AccountingSubsidiariesAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Subsidiaries - CreateSubsidiaryResponse *components.CreateSubsidiaryResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingSubsidiariesAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingSubsidiariesAddResponse) GetCreateSubsidiaryResponse() *components.CreateSubsidiaryResponse { - if o == nil { - return nil - } - return o.CreateSubsidiaryResponse -} - -func (o *AccountingSubsidiariesAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingsubsidiariesall.go b/tests/mockserver/internal/sdk/models/operations/accountingsubsidiariesall.go deleted file mode 100644 index 1b8391a0..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingsubsidiariesall.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingSubsidiariesAllGlobals 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 *AccountingSubsidiariesAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingSubsidiariesAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingSubsidiariesAllRequest 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"` - // 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 AccountingSubsidiariesAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingSubsidiariesAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingSubsidiariesAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingSubsidiariesAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingSubsidiariesAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingSubsidiariesAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingSubsidiariesAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AccountingSubsidiariesAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *AccountingSubsidiariesAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingSubsidiariesAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Subsidiaries - GetSubsidiariesResponse *components.GetSubsidiariesResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AccountingSubsidiariesAllResponse, error) -} - -func (o *AccountingSubsidiariesAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingSubsidiariesAllResponse) GetGetSubsidiariesResponse() *components.GetSubsidiariesResponse { - if o == nil { - return nil - } - return o.GetSubsidiariesResponse -} - -func (o *AccountingSubsidiariesAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingsubsidiariesdelete.go b/tests/mockserver/internal/sdk/models/operations/accountingsubsidiariesdelete.go deleted file mode 100644 index 32b1b6d0..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingsubsidiariesdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingSubsidiariesDeleteGlobals 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 *AccountingSubsidiariesDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingSubsidiariesDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingSubsidiariesDeleteRequest 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 AccountingSubsidiariesDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingSubsidiariesDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingSubsidiariesDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingSubsidiariesDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingSubsidiariesDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingSubsidiariesDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingSubsidiariesDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AccountingSubsidiariesDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Subsidiarys - DeleteSubsidiaryResponse *components.DeleteSubsidiaryResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingSubsidiariesDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingSubsidiariesDeleteResponse) GetDeleteSubsidiaryResponse() *components.DeleteSubsidiaryResponse { - if o == nil { - return nil - } - return o.DeleteSubsidiaryResponse -} - -func (o *AccountingSubsidiariesDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingsubsidiariesone.go b/tests/mockserver/internal/sdk/models/operations/accountingsubsidiariesone.go deleted file mode 100644 index 8096af4f..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingsubsidiariesone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingSubsidiariesOneGlobals 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 *AccountingSubsidiariesOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingSubsidiariesOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingSubsidiariesOneRequest 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 AccountingSubsidiariesOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingSubsidiariesOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingSubsidiariesOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingSubsidiariesOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingSubsidiariesOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingSubsidiariesOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingSubsidiariesOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingSubsidiariesOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingSubsidiariesOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Subsidiary - GetSubsidiaryResponse *components.GetSubsidiaryResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingSubsidiariesOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingSubsidiariesOneResponse) GetGetSubsidiaryResponse() *components.GetSubsidiaryResponse { - if o == nil { - return nil - } - return o.GetSubsidiaryResponse -} - -func (o *AccountingSubsidiariesOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingsubsidiariesupdate.go b/tests/mockserver/internal/sdk/models/operations/accountingsubsidiariesupdate.go deleted file mode 100644 index 529ffecb..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingsubsidiariesupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingSubsidiariesUpdateGlobals 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 *AccountingSubsidiariesUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingSubsidiariesUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingSubsidiariesUpdateRequest 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"` - Subsidiary components.SubsidiaryInput `request:"mediaType=application/json"` -} - -func (a AccountingSubsidiariesUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingSubsidiariesUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingSubsidiariesUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingSubsidiariesUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingSubsidiariesUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingSubsidiariesUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingSubsidiariesUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingSubsidiariesUpdateRequest) GetSubsidiary() components.SubsidiaryInput { - if o == nil { - return components.SubsidiaryInput{} - } - return o.Subsidiary -} - -type AccountingSubsidiariesUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Subsidiaries - UpdateSubsidiaryResponse *components.UpdateSubsidiaryResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingSubsidiariesUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingSubsidiariesUpdateResponse) GetUpdateSubsidiaryResponse() *components.UpdateSubsidiaryResponse { - if o == nil { - return nil - } - return o.UpdateSubsidiaryResponse -} - -func (o *AccountingSubsidiariesUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingsuppliersadd.go b/tests/mockserver/internal/sdk/models/operations/accountingsuppliersadd.go deleted file mode 100644 index 660bb6f5..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingsuppliersadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingSuppliersAddGlobals 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 *AccountingSuppliersAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingSuppliersAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingSuppliersAddRequest 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"` - Supplier components.SupplierInput `request:"mediaType=application/json"` -} - -func (a AccountingSuppliersAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingSuppliersAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingSuppliersAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingSuppliersAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingSuppliersAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingSuppliersAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingSuppliersAddRequest) GetSupplier() components.SupplierInput { - if o == nil { - return components.SupplierInput{} - } - return o.Supplier -} - -type AccountingSuppliersAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Supplier created - CreateSupplierResponse *components.CreateSupplierResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingSuppliersAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingSuppliersAddResponse) GetCreateSupplierResponse() *components.CreateSupplierResponse { - if o == nil { - return nil - } - return o.CreateSupplierResponse -} - -func (o *AccountingSuppliersAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingsuppliersall.go b/tests/mockserver/internal/sdk/models/operations/accountingsuppliersall.go deleted file mode 100644 index 917e96e1..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingsuppliersall.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingSuppliersAllGlobals 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 *AccountingSuppliersAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingSuppliersAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingSuppliersAllRequest 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.SuppliersFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // Apply sorting - Sort *components.SuppliersSort `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 AccountingSuppliersAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingSuppliersAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingSuppliersAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingSuppliersAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingSuppliersAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingSuppliersAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingSuppliersAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AccountingSuppliersAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *AccountingSuppliersAllRequest) GetFilter() *components.SuppliersFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *AccountingSuppliersAllRequest) GetSort() *components.SuppliersSort { - if o == nil { - return nil - } - return o.Sort -} - -func (o *AccountingSuppliersAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *AccountingSuppliersAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingSuppliersAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Suppliers - GetSuppliersResponse *components.GetSuppliersResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AccountingSuppliersAllResponse, error) -} - -func (o *AccountingSuppliersAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingSuppliersAllResponse) GetGetSuppliersResponse() *components.GetSuppliersResponse { - if o == nil { - return nil - } - return o.GetSuppliersResponse -} - -func (o *AccountingSuppliersAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingsuppliersdelete.go b/tests/mockserver/internal/sdk/models/operations/accountingsuppliersdelete.go deleted file mode 100644 index a32492b6..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingsuppliersdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingSuppliersDeleteGlobals 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 *AccountingSuppliersDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingSuppliersDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingSuppliersDeleteRequest 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 AccountingSuppliersDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingSuppliersDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingSuppliersDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingSuppliersDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingSuppliersDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingSuppliersDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingSuppliersDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AccountingSuppliersDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Supplier deleted - DeleteSupplierResponse *components.DeleteSupplierResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingSuppliersDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingSuppliersDeleteResponse) GetDeleteSupplierResponse() *components.DeleteSupplierResponse { - if o == nil { - return nil - } - return o.DeleteSupplierResponse -} - -func (o *AccountingSuppliersDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingsuppliersone.go b/tests/mockserver/internal/sdk/models/operations/accountingsuppliersone.go deleted file mode 100644 index e5114cfa..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingsuppliersone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingSuppliersOneGlobals 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 *AccountingSuppliersOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingSuppliersOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingSuppliersOneRequest 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 AccountingSuppliersOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingSuppliersOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingSuppliersOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingSuppliersOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingSuppliersOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingSuppliersOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingSuppliersOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingSuppliersOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingSuppliersOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Supplier - GetSupplierResponse *components.GetSupplierResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingSuppliersOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingSuppliersOneResponse) GetGetSupplierResponse() *components.GetSupplierResponse { - if o == nil { - return nil - } - return o.GetSupplierResponse -} - -func (o *AccountingSuppliersOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingsuppliersupdate.go b/tests/mockserver/internal/sdk/models/operations/accountingsuppliersupdate.go deleted file mode 100644 index 28c2cb78..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingsuppliersupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingSuppliersUpdateGlobals 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 *AccountingSuppliersUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingSuppliersUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingSuppliersUpdateRequest 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"` - Supplier components.SupplierInput `request:"mediaType=application/json"` -} - -func (a AccountingSuppliersUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingSuppliersUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingSuppliersUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingSuppliersUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingSuppliersUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingSuppliersUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingSuppliersUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingSuppliersUpdateRequest) GetSupplier() components.SupplierInput { - if o == nil { - return components.SupplierInput{} - } - return o.Supplier -} - -type AccountingSuppliersUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Supplier updated - UpdateSupplierResponse *components.UpdateSupplierResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingSuppliersUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingSuppliersUpdateResponse) GetUpdateSupplierResponse() *components.UpdateSupplierResponse { - if o == nil { - return nil - } - return o.UpdateSupplierResponse -} - -func (o *AccountingSuppliersUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingtaxratesadd.go b/tests/mockserver/internal/sdk/models/operations/accountingtaxratesadd.go deleted file mode 100644 index 9766ff8b..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingtaxratesadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingTaxRatesAddGlobals 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 *AccountingTaxRatesAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingTaxRatesAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingTaxRatesAddRequest 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"` - TaxRate components.TaxRateInput `request:"mediaType=application/json"` -} - -func (a AccountingTaxRatesAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingTaxRatesAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingTaxRatesAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingTaxRatesAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingTaxRatesAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingTaxRatesAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingTaxRatesAddRequest) GetTaxRate() components.TaxRateInput { - if o == nil { - return components.TaxRateInput{} - } - return o.TaxRate -} - -type AccountingTaxRatesAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // TaxRate created - CreateTaxRateResponse *components.CreateTaxRateResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingTaxRatesAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingTaxRatesAddResponse) GetCreateTaxRateResponse() *components.CreateTaxRateResponse { - if o == nil { - return nil - } - return o.CreateTaxRateResponse -} - -func (o *AccountingTaxRatesAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingtaxratesall.go b/tests/mockserver/internal/sdk/models/operations/accountingtaxratesall.go deleted file mode 100644 index cd152b9a..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingtaxratesall.go +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingTaxRatesAllGlobals 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 *AccountingTaxRatesAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingTaxRatesAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingTaxRatesAllRequest 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.TaxRatesFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // 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 AccountingTaxRatesAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingTaxRatesAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingTaxRatesAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingTaxRatesAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingTaxRatesAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingTaxRatesAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingTaxRatesAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AccountingTaxRatesAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *AccountingTaxRatesAllRequest) GetFilter() *components.TaxRatesFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *AccountingTaxRatesAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *AccountingTaxRatesAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingTaxRatesAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // TaxRates - GetTaxRatesResponse *components.GetTaxRatesResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AccountingTaxRatesAllResponse, error) -} - -func (o *AccountingTaxRatesAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingTaxRatesAllResponse) GetGetTaxRatesResponse() *components.GetTaxRatesResponse { - if o == nil { - return nil - } - return o.GetTaxRatesResponse -} - -func (o *AccountingTaxRatesAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingtaxratesdelete.go b/tests/mockserver/internal/sdk/models/operations/accountingtaxratesdelete.go deleted file mode 100644 index 955a6706..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingtaxratesdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingTaxRatesDeleteGlobals 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 *AccountingTaxRatesDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingTaxRatesDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingTaxRatesDeleteRequest 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 AccountingTaxRatesDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingTaxRatesDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingTaxRatesDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingTaxRatesDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingTaxRatesDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingTaxRatesDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingTaxRatesDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AccountingTaxRatesDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // TaxRates deleted - DeleteTaxRateResponse *components.DeleteTaxRateResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingTaxRatesDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingTaxRatesDeleteResponse) GetDeleteTaxRateResponse() *components.DeleteTaxRateResponse { - if o == nil { - return nil - } - return o.DeleteTaxRateResponse -} - -func (o *AccountingTaxRatesDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingtaxratesone.go b/tests/mockserver/internal/sdk/models/operations/accountingtaxratesone.go deleted file mode 100644 index 68bdc99c..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingtaxratesone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingTaxRatesOneGlobals 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 *AccountingTaxRatesOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingTaxRatesOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingTaxRatesOneRequest 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 AccountingTaxRatesOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingTaxRatesOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingTaxRatesOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingTaxRatesOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingTaxRatesOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingTaxRatesOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingTaxRatesOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingTaxRatesOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingTaxRatesOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // TaxRate - GetTaxRateResponse *components.GetTaxRateResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingTaxRatesOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingTaxRatesOneResponse) GetGetTaxRateResponse() *components.GetTaxRateResponse { - if o == nil { - return nil - } - return o.GetTaxRateResponse -} - -func (o *AccountingTaxRatesOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingtaxratesupdate.go b/tests/mockserver/internal/sdk/models/operations/accountingtaxratesupdate.go deleted file mode 100644 index b563b276..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingtaxratesupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingTaxRatesUpdateGlobals 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 *AccountingTaxRatesUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingTaxRatesUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingTaxRatesUpdateRequest 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"` - TaxRate components.TaxRateInput `request:"mediaType=application/json"` -} - -func (a AccountingTaxRatesUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingTaxRatesUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingTaxRatesUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingTaxRatesUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingTaxRatesUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingTaxRatesUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingTaxRatesUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingTaxRatesUpdateRequest) GetTaxRate() components.TaxRateInput { - if o == nil { - return components.TaxRateInput{} - } - return o.TaxRate -} - -type AccountingTaxRatesUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // TaxRate updated - UpdateTaxRateResponse *components.UpdateTaxRateResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingTaxRatesUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingTaxRatesUpdateResponse) GetUpdateTaxRateResponse() *components.UpdateTaxRateResponse { - if o == nil { - return nil - } - return o.UpdateTaxRateResponse -} - -func (o *AccountingTaxRatesUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingtrackingcategoriesadd.go b/tests/mockserver/internal/sdk/models/operations/accountingtrackingcategoriesadd.go deleted file mode 100644 index 5e7c1aa9..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingtrackingcategoriesadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingTrackingCategoriesAddGlobals 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 *AccountingTrackingCategoriesAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingTrackingCategoriesAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingTrackingCategoriesAddRequest 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"` - TrackingCategory components.TrackingCategoryInput `request:"mediaType=application/json"` -} - -func (a AccountingTrackingCategoriesAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingTrackingCategoriesAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingTrackingCategoriesAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingTrackingCategoriesAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingTrackingCategoriesAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingTrackingCategoriesAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingTrackingCategoriesAddRequest) GetTrackingCategory() components.TrackingCategoryInput { - if o == nil { - return components.TrackingCategoryInput{} - } - return o.TrackingCategory -} - -type AccountingTrackingCategoriesAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Tracking category created - CreateTrackingCategoryResponse *components.CreateTrackingCategoryResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingTrackingCategoriesAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingTrackingCategoriesAddResponse) GetCreateTrackingCategoryResponse() *components.CreateTrackingCategoryResponse { - if o == nil { - return nil - } - return o.CreateTrackingCategoryResponse -} - -func (o *AccountingTrackingCategoriesAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingtrackingcategoriesall.go b/tests/mockserver/internal/sdk/models/operations/accountingtrackingcategoriesall.go deleted file mode 100644 index 03259169..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingtrackingcategoriesall.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingTrackingCategoriesAllGlobals 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 *AccountingTrackingCategoriesAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingTrackingCategoriesAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingTrackingCategoriesAllRequest 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"` - // 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 AccountingTrackingCategoriesAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingTrackingCategoriesAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingTrackingCategoriesAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingTrackingCategoriesAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingTrackingCategoriesAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingTrackingCategoriesAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingTrackingCategoriesAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AccountingTrackingCategoriesAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *AccountingTrackingCategoriesAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *AccountingTrackingCategoriesAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingTrackingCategoriesAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Tracking categories - GetTrackingCategoriesResponse *components.GetTrackingCategoriesResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AccountingTrackingCategoriesAllResponse, error) -} - -func (o *AccountingTrackingCategoriesAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingTrackingCategoriesAllResponse) GetGetTrackingCategoriesResponse() *components.GetTrackingCategoriesResponse { - if o == nil { - return nil - } - return o.GetTrackingCategoriesResponse -} - -func (o *AccountingTrackingCategoriesAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingtrackingcategoriesdelete.go b/tests/mockserver/internal/sdk/models/operations/accountingtrackingcategoriesdelete.go deleted file mode 100644 index ef31c44f..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingtrackingcategoriesdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingTrackingCategoriesDeleteGlobals 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 *AccountingTrackingCategoriesDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingTrackingCategoriesDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingTrackingCategoriesDeleteRequest 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 AccountingTrackingCategoriesDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingTrackingCategoriesDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingTrackingCategoriesDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingTrackingCategoriesDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingTrackingCategoriesDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingTrackingCategoriesDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingTrackingCategoriesDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AccountingTrackingCategoriesDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Tracking category deleted - DeleteTrackingCategoryResponse *components.DeleteTrackingCategoryResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingTrackingCategoriesDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingTrackingCategoriesDeleteResponse) GetDeleteTrackingCategoryResponse() *components.DeleteTrackingCategoryResponse { - if o == nil { - return nil - } - return o.DeleteTrackingCategoryResponse -} - -func (o *AccountingTrackingCategoriesDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingtrackingcategoriesone.go b/tests/mockserver/internal/sdk/models/operations/accountingtrackingcategoriesone.go deleted file mode 100644 index 71a9e59f..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingtrackingcategoriesone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingTrackingCategoriesOneGlobals 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 *AccountingTrackingCategoriesOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingTrackingCategoriesOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingTrackingCategoriesOneRequest 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 AccountingTrackingCategoriesOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingTrackingCategoriesOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingTrackingCategoriesOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingTrackingCategoriesOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingTrackingCategoriesOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingTrackingCategoriesOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingTrackingCategoriesOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingTrackingCategoriesOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AccountingTrackingCategoriesOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Tracking category - GetTrackingCategoryResponse *components.GetTrackingCategoryResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingTrackingCategoriesOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingTrackingCategoriesOneResponse) GetGetTrackingCategoryResponse() *components.GetTrackingCategoryResponse { - if o == nil { - return nil - } - return o.GetTrackingCategoryResponse -} - -func (o *AccountingTrackingCategoriesOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/accountingtrackingcategoriesupdate.go b/tests/mockserver/internal/sdk/models/operations/accountingtrackingcategoriesupdate.go deleted file mode 100644 index 22334c92..00000000 --- a/tests/mockserver/internal/sdk/models/operations/accountingtrackingcategoriesupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AccountingTrackingCategoriesUpdateGlobals 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 *AccountingTrackingCategoriesUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingTrackingCategoriesUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AccountingTrackingCategoriesUpdateRequest 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"` - TrackingCategory components.TrackingCategoryInput `request:"mediaType=application/json"` -} - -func (a AccountingTrackingCategoriesUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AccountingTrackingCategoriesUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AccountingTrackingCategoriesUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AccountingTrackingCategoriesUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AccountingTrackingCategoriesUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AccountingTrackingCategoriesUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AccountingTrackingCategoriesUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AccountingTrackingCategoriesUpdateRequest) GetTrackingCategory() components.TrackingCategoryInput { - if o == nil { - return components.TrackingCategoryInput{} - } - return o.TrackingCategory -} - -type AccountingTrackingCategoriesUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Tracking category updated - UpdateTrackingCategoryResponse *components.UpdateTrackingCategoryResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AccountingTrackingCategoriesUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AccountingTrackingCategoriesUpdateResponse) GetUpdateTrackingCategoryResponse() *components.UpdateTrackingCategoryResponse { - if o == nil { - return nil - } - return o.UpdateTrackingCategoryResponse -} - -func (o *AccountingTrackingCategoriesUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/atsapplicantsadd.go b/tests/mockserver/internal/sdk/models/operations/atsapplicantsadd.go deleted file mode 100644 index 732afb40..00000000 --- a/tests/mockserver/internal/sdk/models/operations/atsapplicantsadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AtsApplicantsAddGlobals 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 *AtsApplicantsAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsApplicantsAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AtsApplicantsAddRequest 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"` - Applicant components.ApplicantInput `request:"mediaType=application/json"` -} - -func (a AtsApplicantsAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AtsApplicantsAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AtsApplicantsAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AtsApplicantsAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsApplicantsAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AtsApplicantsAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AtsApplicantsAddRequest) GetApplicant() components.ApplicantInput { - if o == nil { - return components.ApplicantInput{} - } - return o.Applicant -} - -type AtsApplicantsAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Applicants - CreateApplicantResponse *components.CreateApplicantResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AtsApplicantsAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AtsApplicantsAddResponse) GetCreateApplicantResponse() *components.CreateApplicantResponse { - if o == nil { - return nil - } - return o.CreateApplicantResponse -} - -func (o *AtsApplicantsAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/atsapplicantsall.go b/tests/mockserver/internal/sdk/models/operations/atsapplicantsall.go deleted file mode 100644 index aac22b21..00000000 --- a/tests/mockserver/internal/sdk/models/operations/atsapplicantsall.go +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AtsApplicantsAllGlobals 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 *AtsApplicantsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsApplicantsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AtsApplicantsAllRequest 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.ApplicantsFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // 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 AtsApplicantsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AtsApplicantsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AtsApplicantsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AtsApplicantsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsApplicantsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AtsApplicantsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AtsApplicantsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AtsApplicantsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *AtsApplicantsAllRequest) GetFilter() *components.ApplicantsFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *AtsApplicantsAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *AtsApplicantsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AtsApplicantsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Applicants - GetApplicantsResponse *components.GetApplicantsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AtsApplicantsAllResponse, error) -} - -func (o *AtsApplicantsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AtsApplicantsAllResponse) GetGetApplicantsResponse() *components.GetApplicantsResponse { - if o == nil { - return nil - } - return o.GetApplicantsResponse -} - -func (o *AtsApplicantsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/atsapplicantsdelete.go b/tests/mockserver/internal/sdk/models/operations/atsapplicantsdelete.go deleted file mode 100644 index eddbc047..00000000 --- a/tests/mockserver/internal/sdk/models/operations/atsapplicantsdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AtsApplicantsDeleteGlobals 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 *AtsApplicantsDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsApplicantsDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AtsApplicantsDeleteRequest 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 AtsApplicantsDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AtsApplicantsDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AtsApplicantsDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AtsApplicantsDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsApplicantsDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AtsApplicantsDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AtsApplicantsDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AtsApplicantsDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Applicants - DeleteApplicantResponse *components.DeleteApplicantResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AtsApplicantsDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AtsApplicantsDeleteResponse) GetDeleteApplicantResponse() *components.DeleteApplicantResponse { - if o == nil { - return nil - } - return o.DeleteApplicantResponse -} - -func (o *AtsApplicantsDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/atsapplicantsone.go b/tests/mockserver/internal/sdk/models/operations/atsapplicantsone.go deleted file mode 100644 index 96c908e0..00000000 --- a/tests/mockserver/internal/sdk/models/operations/atsapplicantsone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AtsApplicantsOneGlobals 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 *AtsApplicantsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsApplicantsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AtsApplicantsOneRequest 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 AtsApplicantsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AtsApplicantsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AtsApplicantsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AtsApplicantsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsApplicantsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AtsApplicantsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AtsApplicantsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AtsApplicantsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AtsApplicantsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Applicants - GetApplicantResponse *components.GetApplicantResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AtsApplicantsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AtsApplicantsOneResponse) GetGetApplicantResponse() *components.GetApplicantResponse { - if o == nil { - return nil - } - return o.GetApplicantResponse -} - -func (o *AtsApplicantsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/atsapplicantsupdate.go b/tests/mockserver/internal/sdk/models/operations/atsapplicantsupdate.go deleted file mode 100644 index 408a9daa..00000000 --- a/tests/mockserver/internal/sdk/models/operations/atsapplicantsupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AtsApplicantsUpdateGlobals 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 *AtsApplicantsUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsApplicantsUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AtsApplicantsUpdateRequest 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"` - Applicant components.ApplicantInput `request:"mediaType=application/json"` -} - -func (a AtsApplicantsUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AtsApplicantsUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AtsApplicantsUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AtsApplicantsUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsApplicantsUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AtsApplicantsUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AtsApplicantsUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AtsApplicantsUpdateRequest) GetApplicant() components.ApplicantInput { - if o == nil { - return components.ApplicantInput{} - } - return o.Applicant -} - -type AtsApplicantsUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Applicants - UpdateApplicantResponse *components.UpdateApplicantResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AtsApplicantsUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AtsApplicantsUpdateResponse) GetUpdateApplicantResponse() *components.UpdateApplicantResponse { - if o == nil { - return nil - } - return o.UpdateApplicantResponse -} - -func (o *AtsApplicantsUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/atsapplicationsadd.go b/tests/mockserver/internal/sdk/models/operations/atsapplicationsadd.go deleted file mode 100644 index 73533a6e..00000000 --- a/tests/mockserver/internal/sdk/models/operations/atsapplicationsadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AtsApplicationsAddGlobals 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 *AtsApplicationsAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsApplicationsAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AtsApplicationsAddRequest 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"` - Application components.ApplicationInput `request:"mediaType=application/json"` -} - -func (a AtsApplicationsAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AtsApplicationsAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AtsApplicationsAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AtsApplicationsAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsApplicationsAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AtsApplicationsAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AtsApplicationsAddRequest) GetApplication() components.ApplicationInput { - if o == nil { - return components.ApplicationInput{} - } - return o.Application -} - -type AtsApplicationsAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Applications - CreateApplicationResponse *components.CreateApplicationResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AtsApplicationsAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AtsApplicationsAddResponse) GetCreateApplicationResponse() *components.CreateApplicationResponse { - if o == nil { - return nil - } - return o.CreateApplicationResponse -} - -func (o *AtsApplicationsAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/atsapplicationsall.go b/tests/mockserver/internal/sdk/models/operations/atsapplicationsall.go deleted file mode 100644 index 7810e3f8..00000000 --- a/tests/mockserver/internal/sdk/models/operations/atsapplicationsall.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AtsApplicationsAllGlobals 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 *AtsApplicationsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsApplicationsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AtsApplicationsAllRequest 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"` - // 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"` - // Number of results to return. Minimum 1, Maximum 200, Default 20 - Limit *int64 `default:"20" queryParam:"style=form,explode=true,name=limit"` -} - -func (a AtsApplicationsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AtsApplicationsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AtsApplicationsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AtsApplicationsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsApplicationsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AtsApplicationsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AtsApplicationsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AtsApplicationsAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *AtsApplicationsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -type AtsApplicationsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Applications - GetApplicationsResponse *components.GetApplicationsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AtsApplicationsAllResponse, error) -} - -func (o *AtsApplicationsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AtsApplicationsAllResponse) GetGetApplicationsResponse() *components.GetApplicationsResponse { - if o == nil { - return nil - } - return o.GetApplicationsResponse -} - -func (o *AtsApplicationsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/atsapplicationsdelete.go b/tests/mockserver/internal/sdk/models/operations/atsapplicationsdelete.go deleted file mode 100644 index 4416bab1..00000000 --- a/tests/mockserver/internal/sdk/models/operations/atsapplicationsdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AtsApplicationsDeleteGlobals 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 *AtsApplicationsDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsApplicationsDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AtsApplicationsDeleteRequest 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 AtsApplicationsDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AtsApplicationsDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AtsApplicationsDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AtsApplicationsDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsApplicationsDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AtsApplicationsDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AtsApplicationsDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AtsApplicationsDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Applications - DeleteApplicationResponse *components.DeleteApplicationResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AtsApplicationsDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AtsApplicationsDeleteResponse) GetDeleteApplicationResponse() *components.DeleteApplicationResponse { - if o == nil { - return nil - } - return o.DeleteApplicationResponse -} - -func (o *AtsApplicationsDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/atsapplicationsone.go b/tests/mockserver/internal/sdk/models/operations/atsapplicationsone.go deleted file mode 100644 index cb831559..00000000 --- a/tests/mockserver/internal/sdk/models/operations/atsapplicationsone.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AtsApplicationsOneGlobals 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 *AtsApplicationsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsApplicationsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AtsApplicationsOneRequest 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 AtsApplicationsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AtsApplicationsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AtsApplicationsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AtsApplicationsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsApplicationsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AtsApplicationsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AtsApplicationsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type AtsApplicationsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Applications - GetApplicationResponse *components.GetApplicationResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AtsApplicationsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AtsApplicationsOneResponse) GetGetApplicationResponse() *components.GetApplicationResponse { - if o == nil { - return nil - } - return o.GetApplicationResponse -} - -func (o *AtsApplicationsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/atsapplicationsupdate.go b/tests/mockserver/internal/sdk/models/operations/atsapplicationsupdate.go deleted file mode 100644 index 14e5465a..00000000 --- a/tests/mockserver/internal/sdk/models/operations/atsapplicationsupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AtsApplicationsUpdateGlobals 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 *AtsApplicationsUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsApplicationsUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AtsApplicationsUpdateRequest 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"` - Application components.ApplicationInput `request:"mediaType=application/json"` -} - -func (a AtsApplicationsUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AtsApplicationsUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AtsApplicationsUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AtsApplicationsUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsApplicationsUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AtsApplicationsUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AtsApplicationsUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AtsApplicationsUpdateRequest) GetApplication() components.ApplicationInput { - if o == nil { - return components.ApplicationInput{} - } - return o.Application -} - -type AtsApplicationsUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Applications - UpdateApplicationResponse *components.UpdateApplicationResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AtsApplicationsUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AtsApplicationsUpdateResponse) GetUpdateApplicationResponse() *components.UpdateApplicationResponse { - if o == nil { - return nil - } - return o.UpdateApplicationResponse -} - -func (o *AtsApplicationsUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/atsjobsall.go b/tests/mockserver/internal/sdk/models/operations/atsjobsall.go deleted file mode 100644 index f9a09aba..00000000 --- a/tests/mockserver/internal/sdk/models/operations/atsjobsall.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AtsJobsAllGlobals 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 *AtsJobsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsJobsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AtsJobsAllRequest 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"` - // 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 AtsJobsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AtsJobsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AtsJobsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AtsJobsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsJobsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AtsJobsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AtsJobsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *AtsJobsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *AtsJobsAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *AtsJobsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AtsJobsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Jobs - GetJobsResponse *components.GetJobsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*AtsJobsAllResponse, error) -} - -func (o *AtsJobsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AtsJobsAllResponse) GetGetJobsResponse() *components.GetJobsResponse { - if o == nil { - return nil - } - return o.GetJobsResponse -} - -func (o *AtsJobsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/atsjobsone.go b/tests/mockserver/internal/sdk/models/operations/atsjobsone.go deleted file mode 100644 index 7ca84158..00000000 --- a/tests/mockserver/internal/sdk/models/operations/atsjobsone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type AtsJobsOneGlobals 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 *AtsJobsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsJobsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type AtsJobsOneRequest 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 AtsJobsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *AtsJobsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - -func (o *AtsJobsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *AtsJobsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *AtsJobsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *AtsJobsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *AtsJobsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *AtsJobsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type AtsJobsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Jobs - GetJobResponse *components.GetJobResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *AtsJobsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *AtsJobsOneResponse) GetGetJobResponse() *components.GetJobResponse { - if o == nil { - return nil - } - return o.GetJobResponse -} - -func (o *AtsJobsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/connectorapiresourcecoverageone.go b/tests/mockserver/internal/sdk/models/operations/connectorapiresourcecoverageone.go deleted file mode 100644 index 1f7c29fb..00000000 --- a/tests/mockserver/internal/sdk/models/operations/connectorapiresourcecoverageone.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type ConnectorAPIResourceCoverageOneGlobals struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` -} - -func (o *ConnectorAPIResourceCoverageOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type ConnectorAPIResourceCoverageOneRequest struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` - // ID of the record you are acting upon. - ID string `pathParam:"style=simple,explode=false,name=id"` - // ID of the resource you are acting upon. - ResourceID string `pathParam:"style=simple,explode=false,name=resource_id"` -} - -func (o *ConnectorAPIResourceCoverageOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *ConnectorAPIResourceCoverageOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *ConnectorAPIResourceCoverageOneRequest) GetResourceID() string { - if o == nil { - return "" - } - return o.ResourceID -} - -type ConnectorAPIResourceCoverageOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // ApiResources - GetAPIResourceCoverageResponse *components.GetAPIResourceCoverageResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *ConnectorAPIResourceCoverageOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *ConnectorAPIResourceCoverageOneResponse) GetGetAPIResourceCoverageResponse() *components.GetAPIResourceCoverageResponse { - if o == nil { - return nil - } - return o.GetAPIResourceCoverageResponse -} - -func (o *ConnectorAPIResourceCoverageOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/connectorapiresourcesone.go b/tests/mockserver/internal/sdk/models/operations/connectorapiresourcesone.go deleted file mode 100644 index 2db15cf8..00000000 --- a/tests/mockserver/internal/sdk/models/operations/connectorapiresourcesone.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type ConnectorAPIResourcesOneGlobals struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` -} - -func (o *ConnectorAPIResourcesOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type ConnectorAPIResourcesOneRequest struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` - // ID of the record you are acting upon. - ID string `pathParam:"style=simple,explode=false,name=id"` - // ID of the resource you are acting upon. - ResourceID string `pathParam:"style=simple,explode=false,name=resource_id"` -} - -func (o *ConnectorAPIResourcesOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *ConnectorAPIResourcesOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *ConnectorAPIResourcesOneRequest) GetResourceID() string { - if o == nil { - return "" - } - return o.ResourceID -} - -type ConnectorAPIResourcesOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // ApiResources - GetAPIResourceResponse *components.GetAPIResourceResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *ConnectorAPIResourcesOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *ConnectorAPIResourcesOneResponse) GetGetAPIResourceResponse() *components.GetAPIResourceResponse { - if o == nil { - return nil - } - return o.GetAPIResourceResponse -} - -func (o *ConnectorAPIResourcesOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/connectorapisall.go b/tests/mockserver/internal/sdk/models/operations/connectorapisall.go deleted file mode 100644 index 2bf786ec..00000000 --- a/tests/mockserver/internal/sdk/models/operations/connectorapisall.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type ConnectorApisAllGlobals struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` -} - -func (o *ConnectorApisAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type ConnectorApisAllRequest struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-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.ApisFilter `queryParam:"style=deepObject,explode=true,name=filter"` -} - -func (c ConnectorApisAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ConnectorApisAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ConnectorApisAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *ConnectorApisAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *ConnectorApisAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *ConnectorApisAllRequest) GetFilter() *components.ApisFilter { - if o == nil { - return nil - } - return o.Filter -} - -type ConnectorApisAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Apis - GetApisResponse *components.GetApisResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*ConnectorApisAllResponse, error) -} - -func (o *ConnectorApisAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *ConnectorApisAllResponse) GetGetApisResponse() *components.GetApisResponse { - if o == nil { - return nil - } - return o.GetApisResponse -} - -func (o *ConnectorApisAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/connectorapisone.go b/tests/mockserver/internal/sdk/models/operations/connectorapisone.go deleted file mode 100644 index a6489e37..00000000 --- a/tests/mockserver/internal/sdk/models/operations/connectorapisone.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type ConnectorApisOneGlobals struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` -} - -func (o *ConnectorApisOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type ConnectorApisOneRequest struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` - // ID of the record you are acting upon. - ID string `pathParam:"style=simple,explode=false,name=id"` -} - -func (o *ConnectorApisOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *ConnectorApisOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -type ConnectorApisOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Apis - GetAPIResponse *components.GetAPIResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *ConnectorApisOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *ConnectorApisOneResponse) GetGetAPIResponse() *components.GetAPIResponse { - if o == nil { - return nil - } - return o.GetAPIResponse -} - -func (o *ConnectorApisOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/connectorconnectordocsone.go b/tests/mockserver/internal/sdk/models/operations/connectorconnectordocsone.go deleted file mode 100644 index d98ffef7..00000000 --- a/tests/mockserver/internal/sdk/models/operations/connectorconnectordocsone.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type ConnectorConnectorDocsOneGlobals struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` -} - -func (o *ConnectorConnectorDocsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type ConnectorConnectorDocsOneRequest struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` - // ID of the record you are acting upon. - ID string `pathParam:"style=simple,explode=false,name=id"` - // ID of the Doc - DocID string `pathParam:"style=simple,explode=false,name=doc_id"` -} - -func (o *ConnectorConnectorDocsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *ConnectorConnectorDocsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *ConnectorConnectorDocsOneRequest) GetDocID() string { - if o == nil { - return "" - } - return o.DocID -} - -type ConnectorConnectorDocsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Connectors - GetConnectorDocResponse *string - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *ConnectorConnectorDocsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *ConnectorConnectorDocsOneResponse) GetGetConnectorDocResponse() *string { - if o == nil { - return nil - } - return o.GetConnectorDocResponse -} - -func (o *ConnectorConnectorDocsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/connectorconnectorresourcesone.go b/tests/mockserver/internal/sdk/models/operations/connectorconnectorresourcesone.go deleted file mode 100644 index a3531afe..00000000 --- a/tests/mockserver/internal/sdk/models/operations/connectorconnectorresourcesone.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type ConnectorConnectorResourcesOneGlobals struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` -} - -func (o *ConnectorConnectorResourcesOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type ConnectorConnectorResourcesOneRequest struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` - // ID of the record you are acting upon. - ID string `pathParam:"style=simple,explode=false,name=id"` - // ID of the resource you are acting upon. - ResourceID string `pathParam:"style=simple,explode=false,name=resource_id"` - // Specify unified API for the connector resource. This is useful when a resource appears in multiple APIs - UnifiedAPI *components.UnifiedAPIID `queryParam:"style=form,explode=true,name=unified_api"` -} - -func (o *ConnectorConnectorResourcesOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *ConnectorConnectorResourcesOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *ConnectorConnectorResourcesOneRequest) GetResourceID() string { - if o == nil { - return "" - } - return o.ResourceID -} - -func (o *ConnectorConnectorResourcesOneRequest) GetUnifiedAPI() *components.UnifiedAPIID { - if o == nil { - return nil - } - return o.UnifiedAPI -} - -type ConnectorConnectorResourcesOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // ConnectorResources - GetConnectorResourceResponse *components.GetConnectorResourceResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *ConnectorConnectorResourcesOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *ConnectorConnectorResourcesOneResponse) GetGetConnectorResourceResponse() *components.GetConnectorResourceResponse { - if o == nil { - return nil - } - return o.GetConnectorResourceResponse -} - -func (o *ConnectorConnectorResourcesOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/connectorconnectorsall.go b/tests/mockserver/internal/sdk/models/operations/connectorconnectorsall.go deleted file mode 100644 index e189f223..00000000 --- a/tests/mockserver/internal/sdk/models/operations/connectorconnectorsall.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type ConnectorConnectorsAllGlobals struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` -} - -func (o *ConnectorConnectorsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type ConnectorConnectorsAllRequest struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-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.ConnectorsFilter `queryParam:"style=deepObject,explode=true,name=filter"` -} - -func (c ConnectorConnectorsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ConnectorConnectorsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *ConnectorConnectorsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *ConnectorConnectorsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *ConnectorConnectorsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *ConnectorConnectorsAllRequest) GetFilter() *components.ConnectorsFilter { - if o == nil { - return nil - } - return o.Filter -} - -type ConnectorConnectorsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Connectors - GetConnectorsResponse *components.GetConnectorsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*ConnectorConnectorsAllResponse, error) -} - -func (o *ConnectorConnectorsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *ConnectorConnectorsAllResponse) GetGetConnectorsResponse() *components.GetConnectorsResponse { - if o == nil { - return nil - } - return o.GetConnectorsResponse -} - -func (o *ConnectorConnectorsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/connectorconnectorsone.go b/tests/mockserver/internal/sdk/models/operations/connectorconnectorsone.go deleted file mode 100644 index f1a4e078..00000000 --- a/tests/mockserver/internal/sdk/models/operations/connectorconnectorsone.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type ConnectorConnectorsOneGlobals struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` -} - -func (o *ConnectorConnectorsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type ConnectorConnectorsOneRequest struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` - // ID of the record you are acting upon. - ID string `pathParam:"style=simple,explode=false,name=id"` -} - -func (o *ConnectorConnectorsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *ConnectorConnectorsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -type ConnectorConnectorsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Connectors - GetConnectorResponse *components.GetConnectorResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *ConnectorConnectorsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *ConnectorConnectorsOneResponse) GetGetConnectorResponse() *components.GetConnectorResponse { - if o == nil { - return nil - } - return o.GetConnectorResponse -} - -func (o *ConnectorConnectorsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmactivitiesadd.go b/tests/mockserver/internal/sdk/models/operations/crmactivitiesadd.go deleted file mode 100644 index 2cb39421..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmactivitiesadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmActivitiesAddGlobals 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 *CrmActivitiesAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmActivitiesAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmActivitiesAddRequest 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"` - Activity components.ActivityInput `request:"mediaType=application/json"` -} - -func (c CrmActivitiesAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmActivitiesAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmActivitiesAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmActivitiesAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmActivitiesAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmActivitiesAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmActivitiesAddRequest) GetActivity() components.ActivityInput { - if o == nil { - return components.ActivityInput{} - } - return o.Activity -} - -type CrmActivitiesAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Activity created - CreateActivityResponse *components.CreateActivityResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmActivitiesAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmActivitiesAddResponse) GetCreateActivityResponse() *components.CreateActivityResponse { - if o == nil { - return nil - } - return o.CreateActivityResponse -} - -func (o *CrmActivitiesAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmactivitiesall.go b/tests/mockserver/internal/sdk/models/operations/crmactivitiesall.go deleted file mode 100644 index fd7c5f58..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmactivitiesall.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmActivitiesAllGlobals 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 *CrmActivitiesAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmActivitiesAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmActivitiesAllRequest 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.ActivitiesFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // Apply sorting - Sort *components.ActivitiesSort `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 (c CrmActivitiesAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmActivitiesAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmActivitiesAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmActivitiesAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmActivitiesAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmActivitiesAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmActivitiesAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *CrmActivitiesAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *CrmActivitiesAllRequest) GetFilter() *components.ActivitiesFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *CrmActivitiesAllRequest) GetSort() *components.ActivitiesSort { - if o == nil { - return nil - } - return o.Sort -} - -func (o *CrmActivitiesAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *CrmActivitiesAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type CrmActivitiesAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Activities - GetActivitiesResponse *components.GetActivitiesResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*CrmActivitiesAllResponse, error) -} - -func (o *CrmActivitiesAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmActivitiesAllResponse) GetGetActivitiesResponse() *components.GetActivitiesResponse { - if o == nil { - return nil - } - return o.GetActivitiesResponse -} - -func (o *CrmActivitiesAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmactivitiesdelete.go b/tests/mockserver/internal/sdk/models/operations/crmactivitiesdelete.go deleted file mode 100644 index 972b270e..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmactivitiesdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmActivitiesDeleteGlobals 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 *CrmActivitiesDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmActivitiesDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmActivitiesDeleteRequest 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 (c CrmActivitiesDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmActivitiesDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmActivitiesDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmActivitiesDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmActivitiesDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmActivitiesDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmActivitiesDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type CrmActivitiesDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Activity deleted - DeleteActivityResponse *components.DeleteActivityResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmActivitiesDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmActivitiesDeleteResponse) GetDeleteActivityResponse() *components.DeleteActivityResponse { - if o == nil { - return nil - } - return o.DeleteActivityResponse -} - -func (o *CrmActivitiesDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmactivitiesone.go b/tests/mockserver/internal/sdk/models/operations/crmactivitiesone.go deleted file mode 100644 index 6e2e717b..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmactivitiesone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmActivitiesOneGlobals 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 *CrmActivitiesOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmActivitiesOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmActivitiesOneRequest 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 (c CrmActivitiesOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmActivitiesOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmActivitiesOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmActivitiesOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmActivitiesOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmActivitiesOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmActivitiesOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmActivitiesOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type CrmActivitiesOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Activity - GetActivityResponse *components.GetActivityResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmActivitiesOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmActivitiesOneResponse) GetGetActivityResponse() *components.GetActivityResponse { - if o == nil { - return nil - } - return o.GetActivityResponse -} - -func (o *CrmActivitiesOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmactivitiesupdate.go b/tests/mockserver/internal/sdk/models/operations/crmactivitiesupdate.go deleted file mode 100644 index da8a9d4c..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmactivitiesupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmActivitiesUpdateGlobals 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 *CrmActivitiesUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmActivitiesUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmActivitiesUpdateRequest 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"` - Activity components.ActivityInput `request:"mediaType=application/json"` -} - -func (c CrmActivitiesUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmActivitiesUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmActivitiesUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmActivitiesUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmActivitiesUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmActivitiesUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmActivitiesUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmActivitiesUpdateRequest) GetActivity() components.ActivityInput { - if o == nil { - return components.ActivityInput{} - } - return o.Activity -} - -type CrmActivitiesUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Activity updated - UpdateActivityResponse *components.UpdateActivityResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmActivitiesUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmActivitiesUpdateResponse) GetUpdateActivityResponse() *components.UpdateActivityResponse { - if o == nil { - return nil - } - return o.UpdateActivityResponse -} - -func (o *CrmActivitiesUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmcompaniesadd.go b/tests/mockserver/internal/sdk/models/operations/crmcompaniesadd.go deleted file mode 100644 index 248277f3..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmcompaniesadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmCompaniesAddGlobals 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 *CrmCompaniesAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCompaniesAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmCompaniesAddRequest 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"` - Company components.CompanyInput `request:"mediaType=application/json"` -} - -func (c CrmCompaniesAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmCompaniesAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmCompaniesAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmCompaniesAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCompaniesAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmCompaniesAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmCompaniesAddRequest) GetCompany() components.CompanyInput { - if o == nil { - return components.CompanyInput{} - } - return o.Company -} - -type CrmCompaniesAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Company created - CreateCompanyResponse *components.CreateCompanyResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmCompaniesAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmCompaniesAddResponse) GetCreateCompanyResponse() *components.CreateCompanyResponse { - if o == nil { - return nil - } - return o.CreateCompanyResponse -} - -func (o *CrmCompaniesAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmcompaniesall.go b/tests/mockserver/internal/sdk/models/operations/crmcompaniesall.go deleted file mode 100644 index 3587ace6..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmcompaniesall.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmCompaniesAllGlobals 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 *CrmCompaniesAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCompaniesAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmCompaniesAllRequest 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.CompaniesFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // Apply sorting - Sort *components.CompaniesSort `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 (c CrmCompaniesAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmCompaniesAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmCompaniesAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmCompaniesAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCompaniesAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmCompaniesAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmCompaniesAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *CrmCompaniesAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *CrmCompaniesAllRequest) GetFilter() *components.CompaniesFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *CrmCompaniesAllRequest) GetSort() *components.CompaniesSort { - if o == nil { - return nil - } - return o.Sort -} - -func (o *CrmCompaniesAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *CrmCompaniesAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type CrmCompaniesAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Companies - GetCompaniesResponse *components.GetCompaniesResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*CrmCompaniesAllResponse, error) -} - -func (o *CrmCompaniesAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmCompaniesAllResponse) GetGetCompaniesResponse() *components.GetCompaniesResponse { - if o == nil { - return nil - } - return o.GetCompaniesResponse -} - -func (o *CrmCompaniesAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmcompaniesdelete.go b/tests/mockserver/internal/sdk/models/operations/crmcompaniesdelete.go deleted file mode 100644 index 2eb31b13..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmcompaniesdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmCompaniesDeleteGlobals 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 *CrmCompaniesDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCompaniesDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmCompaniesDeleteRequest struct { - // ID of the record you are acting upon. - ID string `pathParam:"style=simple,explode=false,name=id"` - // 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"` -} - -func (c CrmCompaniesDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmCompaniesDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmCompaniesDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmCompaniesDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmCompaniesDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCompaniesDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmCompaniesDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -type CrmCompaniesDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Company deleted - DeleteCompanyResponse *components.DeleteCompanyResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmCompaniesDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmCompaniesDeleteResponse) GetDeleteCompanyResponse() *components.DeleteCompanyResponse { - if o == nil { - return nil - } - return o.DeleteCompanyResponse -} - -func (o *CrmCompaniesDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmcompaniesone.go b/tests/mockserver/internal/sdk/models/operations/crmcompaniesone.go deleted file mode 100644 index f280c3bb..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmcompaniesone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmCompaniesOneGlobals 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 *CrmCompaniesOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCompaniesOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmCompaniesOneRequest struct { - // ID of the record you are acting upon. - ID string `pathParam:"style=simple,explode=false,name=id"` - // 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"` - // 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 (c CrmCompaniesOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmCompaniesOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmCompaniesOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmCompaniesOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmCompaniesOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCompaniesOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmCompaniesOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmCompaniesOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type CrmCompaniesOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Company - GetCompanyResponse *components.GetCompanyResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmCompaniesOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmCompaniesOneResponse) GetGetCompanyResponse() *components.GetCompanyResponse { - if o == nil { - return nil - } - return o.GetCompanyResponse -} - -func (o *CrmCompaniesOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmcompaniesupdate.go b/tests/mockserver/internal/sdk/models/operations/crmcompaniesupdate.go deleted file mode 100644 index e6013cd3..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmcompaniesupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmCompaniesUpdateGlobals 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 *CrmCompaniesUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCompaniesUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmCompaniesUpdateRequest struct { - // ID of the record you are acting upon. - ID string `pathParam:"style=simple,explode=false,name=id"` - // 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"` - Company components.CompanyInput `request:"mediaType=application/json"` -} - -func (c CrmCompaniesUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmCompaniesUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmCompaniesUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmCompaniesUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmCompaniesUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCompaniesUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmCompaniesUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmCompaniesUpdateRequest) GetCompany() components.CompanyInput { - if o == nil { - return components.CompanyInput{} - } - return o.Company -} - -type CrmCompaniesUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Company updated - UpdateCompanyResponse *components.UpdateCompanyResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmCompaniesUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmCompaniesUpdateResponse) GetUpdateCompanyResponse() *components.UpdateCompanyResponse { - if o == nil { - return nil - } - return o.UpdateCompanyResponse -} - -func (o *CrmCompaniesUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmcontactsadd.go b/tests/mockserver/internal/sdk/models/operations/crmcontactsadd.go deleted file mode 100644 index a34055b0..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmcontactsadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmContactsAddGlobals 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 *CrmContactsAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmContactsAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmContactsAddRequest 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"` - Contact components.ContactInput `request:"mediaType=application/json"` -} - -func (c CrmContactsAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmContactsAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmContactsAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmContactsAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmContactsAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmContactsAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmContactsAddRequest) GetContact() components.ContactInput { - if o == nil { - return components.ContactInput{} - } - return o.Contact -} - -type CrmContactsAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Contact created - CreateContactResponse *components.CreateContactResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmContactsAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmContactsAddResponse) GetCreateContactResponse() *components.CreateContactResponse { - if o == nil { - return nil - } - return o.CreateContactResponse -} - -func (o *CrmContactsAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmcontactsall.go b/tests/mockserver/internal/sdk/models/operations/crmcontactsall.go deleted file mode 100644 index e93ab33f..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmcontactsall.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmContactsAllGlobals 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 *CrmContactsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmContactsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmContactsAllRequest 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.ContactsFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // Apply sorting - Sort *components.ContactsSort `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 (c CrmContactsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmContactsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmContactsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmContactsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmContactsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmContactsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmContactsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *CrmContactsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *CrmContactsAllRequest) GetFilter() *components.ContactsFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *CrmContactsAllRequest) GetSort() *components.ContactsSort { - if o == nil { - return nil - } - return o.Sort -} - -func (o *CrmContactsAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *CrmContactsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type CrmContactsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Contacts - GetContactsResponse *components.GetContactsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*CrmContactsAllResponse, error) -} - -func (o *CrmContactsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmContactsAllResponse) GetGetContactsResponse() *components.GetContactsResponse { - if o == nil { - return nil - } - return o.GetContactsResponse -} - -func (o *CrmContactsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmcontactsdelete.go b/tests/mockserver/internal/sdk/models/operations/crmcontactsdelete.go deleted file mode 100644 index 3333c020..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmcontactsdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmContactsDeleteGlobals 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 *CrmContactsDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmContactsDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmContactsDeleteRequest 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 (c CrmContactsDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmContactsDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmContactsDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmContactsDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmContactsDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmContactsDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmContactsDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type CrmContactsDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Contact deleted - DeleteContactResponse *components.DeleteContactResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmContactsDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmContactsDeleteResponse) GetDeleteContactResponse() *components.DeleteContactResponse { - if o == nil { - return nil - } - return o.DeleteContactResponse -} - -func (o *CrmContactsDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmcontactsone.go b/tests/mockserver/internal/sdk/models/operations/crmcontactsone.go deleted file mode 100644 index e3350a82..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmcontactsone.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmContactsOneGlobals 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 *CrmContactsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmContactsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmContactsOneRequest 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"` - // Apply filters - Filter *components.ContactsFilter `queryParam:"style=deepObject,explode=true,name=filter"` -} - -func (c CrmContactsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmContactsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmContactsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmContactsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmContactsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmContactsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmContactsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmContactsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -func (o *CrmContactsOneRequest) GetFilter() *components.ContactsFilter { - if o == nil { - return nil - } - return o.Filter -} - -type CrmContactsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Contact - GetContactResponse *components.GetContactResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmContactsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmContactsOneResponse) GetGetContactResponse() *components.GetContactResponse { - if o == nil { - return nil - } - return o.GetContactResponse -} - -func (o *CrmContactsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmcontactsupdate.go b/tests/mockserver/internal/sdk/models/operations/crmcontactsupdate.go deleted file mode 100644 index 581fb623..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmcontactsupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmContactsUpdateGlobals 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 *CrmContactsUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmContactsUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmContactsUpdateRequest 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"` - Contact components.ContactInput `request:"mediaType=application/json"` -} - -func (c CrmContactsUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmContactsUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmContactsUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmContactsUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmContactsUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmContactsUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmContactsUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmContactsUpdateRequest) GetContact() components.ContactInput { - if o == nil { - return components.ContactInput{} - } - return o.Contact -} - -type CrmContactsUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Contact updated - UpdateContactResponse *components.UpdateContactResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmContactsUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmContactsUpdateResponse) GetUpdateContactResponse() *components.UpdateContactResponse { - if o == nil { - return nil - } - return o.UpdateContactResponse -} - -func (o *CrmContactsUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmcustomobjectsadd.go b/tests/mockserver/internal/sdk/models/operations/crmcustomobjectsadd.go deleted file mode 100644 index 08ad9101..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmcustomobjectsadd.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmCustomObjectsAddGlobals 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 *CrmCustomObjectsAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCustomObjectsAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmCustomObjectsAddRequest 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"` - // The id of the custom object to query - ObjectID string `pathParam:"style=simple,explode=false,name=object_id"` - CustomObject components.CustomObjectInput `request:"mediaType=application/json"` -} - -func (c CrmCustomObjectsAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmCustomObjectsAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmCustomObjectsAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmCustomObjectsAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCustomObjectsAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmCustomObjectsAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmCustomObjectsAddRequest) GetObjectID() string { - if o == nil { - return "" - } - return o.ObjectID -} - -func (o *CrmCustomObjectsAddRequest) GetCustomObject() components.CustomObjectInput { - if o == nil { - return components.CustomObjectInput{} - } - return o.CustomObject -} - -type CrmCustomObjectsAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Custom object created - CreateCustomObjectResponse *components.CreateCustomObjectResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmCustomObjectsAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmCustomObjectsAddResponse) GetCreateCustomObjectResponse() *components.CreateCustomObjectResponse { - if o == nil { - return nil - } - return o.CreateCustomObjectResponse -} - -func (o *CrmCustomObjectsAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmcustomobjectsall.go b/tests/mockserver/internal/sdk/models/operations/crmcustomobjectsall.go deleted file mode 100644 index 4b40de52..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmcustomobjectsall.go +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmCustomObjectsAllGlobals 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 *CrmCustomObjectsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCustomObjectsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmCustomObjectsAllRequest 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"` - // 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"` - // The id of the custom object to query - ObjectID string `pathParam:"style=simple,explode=false,name=object_id"` -} - -func (c CrmCustomObjectsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmCustomObjectsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmCustomObjectsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmCustomObjectsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCustomObjectsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmCustomObjectsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmCustomObjectsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *CrmCustomObjectsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *CrmCustomObjectsAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *CrmCustomObjectsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -func (o *CrmCustomObjectsAllRequest) GetObjectID() string { - if o == nil { - return "" - } - return o.ObjectID -} - -type CrmCustomObjectsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Custom objects - GetCustomObjectsResponse *components.GetCustomObjectsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*CrmCustomObjectsAllResponse, error) -} - -func (o *CrmCustomObjectsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmCustomObjectsAllResponse) GetGetCustomObjectsResponse() *components.GetCustomObjectsResponse { - if o == nil { - return nil - } - return o.GetCustomObjectsResponse -} - -func (o *CrmCustomObjectsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmcustomobjectschemasadd.go b/tests/mockserver/internal/sdk/models/operations/crmcustomobjectschemasadd.go deleted file mode 100644 index d01d1b73..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmcustomobjectschemasadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmCustomObjectSchemasAddGlobals 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 *CrmCustomObjectSchemasAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCustomObjectSchemasAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmCustomObjectSchemasAddRequest 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"` - CustomObjectSchema components.CustomObjectSchemaInput `request:"mediaType=application/json"` -} - -func (c CrmCustomObjectSchemasAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmCustomObjectSchemasAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmCustomObjectSchemasAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmCustomObjectSchemasAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCustomObjectSchemasAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmCustomObjectSchemasAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmCustomObjectSchemasAddRequest) GetCustomObjectSchema() components.CustomObjectSchemaInput { - if o == nil { - return components.CustomObjectSchemaInput{} - } - return o.CustomObjectSchema -} - -type CrmCustomObjectSchemasAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Custom object schema created - CreateCustomObjectSchemaResponse *components.CreateCustomObjectSchemaResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmCustomObjectSchemasAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmCustomObjectSchemasAddResponse) GetCreateCustomObjectSchemaResponse() *components.CreateCustomObjectSchemaResponse { - if o == nil { - return nil - } - return o.CreateCustomObjectSchemaResponse -} - -func (o *CrmCustomObjectSchemasAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmcustomobjectschemasall.go b/tests/mockserver/internal/sdk/models/operations/crmcustomobjectschemasall.go deleted file mode 100644 index ecfd6b59..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmcustomobjectschemasall.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmCustomObjectSchemasAllGlobals 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 *CrmCustomObjectSchemasAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCustomObjectSchemasAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmCustomObjectSchemasAllRequest 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"` - // 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"` -} - -func (c CrmCustomObjectSchemasAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmCustomObjectSchemasAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmCustomObjectSchemasAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmCustomObjectSchemasAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCustomObjectSchemasAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmCustomObjectSchemasAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmCustomObjectSchemasAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *CrmCustomObjectSchemasAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *CrmCustomObjectSchemasAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -type CrmCustomObjectSchemasAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Custom object schemas - GetCustomObjectSchemasResponse *components.GetCustomObjectSchemasResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*CrmCustomObjectSchemasAllResponse, error) -} - -func (o *CrmCustomObjectSchemasAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmCustomObjectSchemasAllResponse) GetGetCustomObjectSchemasResponse() *components.GetCustomObjectSchemasResponse { - if o == nil { - return nil - } - return o.GetCustomObjectSchemasResponse -} - -func (o *CrmCustomObjectSchemasAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmcustomobjectschemasdelete.go b/tests/mockserver/internal/sdk/models/operations/crmcustomobjectschemasdelete.go deleted file mode 100644 index 2aff2218..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmcustomobjectschemasdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmCustomObjectSchemasDeleteGlobals 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 *CrmCustomObjectSchemasDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCustomObjectSchemasDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmCustomObjectSchemasDeleteRequest 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 (c CrmCustomObjectSchemasDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmCustomObjectSchemasDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmCustomObjectSchemasDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmCustomObjectSchemasDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCustomObjectSchemasDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmCustomObjectSchemasDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmCustomObjectSchemasDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type CrmCustomObjectSchemasDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Custom object schema deleted - DeleteCustomObjectSchemaResponse *components.DeleteCustomObjectSchemaResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmCustomObjectSchemasDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmCustomObjectSchemasDeleteResponse) GetDeleteCustomObjectSchemaResponse() *components.DeleteCustomObjectSchemaResponse { - if o == nil { - return nil - } - return o.DeleteCustomObjectSchemaResponse -} - -func (o *CrmCustomObjectSchemasDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmcustomobjectschemasone.go b/tests/mockserver/internal/sdk/models/operations/crmcustomobjectschemasone.go deleted file mode 100644 index a73949b8..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmcustomobjectschemasone.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmCustomObjectSchemasOneGlobals 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 *CrmCustomObjectSchemasOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCustomObjectSchemasOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmCustomObjectSchemasOneRequest 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 (c CrmCustomObjectSchemasOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmCustomObjectSchemasOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmCustomObjectSchemasOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmCustomObjectSchemasOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCustomObjectSchemasOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmCustomObjectSchemasOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmCustomObjectSchemasOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type CrmCustomObjectSchemasOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Custom object schema - GetCustomObjectSchemaResponse *components.GetCustomObjectSchemaResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmCustomObjectSchemasOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmCustomObjectSchemasOneResponse) GetGetCustomObjectSchemaResponse() *components.GetCustomObjectSchemaResponse { - if o == nil { - return nil - } - return o.GetCustomObjectSchemaResponse -} - -func (o *CrmCustomObjectSchemasOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmcustomobjectschemasupdate.go b/tests/mockserver/internal/sdk/models/operations/crmcustomobjectschemasupdate.go deleted file mode 100644 index 249728bc..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmcustomobjectschemasupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmCustomObjectSchemasUpdateGlobals 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 *CrmCustomObjectSchemasUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCustomObjectSchemasUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmCustomObjectSchemasUpdateRequest 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"` - CustomObjectSchema components.CustomObjectSchemaInput `request:"mediaType=application/json"` -} - -func (c CrmCustomObjectSchemasUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmCustomObjectSchemasUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmCustomObjectSchemasUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmCustomObjectSchemasUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCustomObjectSchemasUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmCustomObjectSchemasUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmCustomObjectSchemasUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmCustomObjectSchemasUpdateRequest) GetCustomObjectSchema() components.CustomObjectSchemaInput { - if o == nil { - return components.CustomObjectSchemaInput{} - } - return o.CustomObjectSchema -} - -type CrmCustomObjectSchemasUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Custom object schema updated - UpdateCustomObjectSchemaResponse *components.UpdateCustomObjectSchemaResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmCustomObjectSchemasUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmCustomObjectSchemasUpdateResponse) GetUpdateCustomObjectSchemaResponse() *components.UpdateCustomObjectSchemaResponse { - if o == nil { - return nil - } - return o.UpdateCustomObjectSchemaResponse -} - -func (o *CrmCustomObjectSchemasUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmcustomobjectsdelete.go b/tests/mockserver/internal/sdk/models/operations/crmcustomobjectsdelete.go deleted file mode 100644 index 0e42f2bb..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmcustomobjectsdelete.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmCustomObjectsDeleteGlobals 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 *CrmCustomObjectsDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCustomObjectsDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmCustomObjectsDeleteRequest 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 id of the custom object to query - ObjectID string `pathParam:"style=simple,explode=false,name=object_id"` -} - -func (c CrmCustomObjectsDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmCustomObjectsDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmCustomObjectsDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmCustomObjectsDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCustomObjectsDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmCustomObjectsDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmCustomObjectsDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmCustomObjectsDeleteRequest) GetObjectID() string { - if o == nil { - return "" - } - return o.ObjectID -} - -type CrmCustomObjectsDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Custom object deleted - DeleteCustomObjectResponse *components.DeleteCustomObjectResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmCustomObjectsDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmCustomObjectsDeleteResponse) GetDeleteCustomObjectResponse() *components.DeleteCustomObjectResponse { - if o == nil { - return nil - } - return o.DeleteCustomObjectResponse -} - -func (o *CrmCustomObjectsDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmcustomobjectsone.go b/tests/mockserver/internal/sdk/models/operations/crmcustomobjectsone.go deleted file mode 100644 index 803caa43..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmcustomobjectsone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmCustomObjectsOneGlobals 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 *CrmCustomObjectsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCustomObjectsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmCustomObjectsOneRequest 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 id of the custom object to query - ObjectID string `pathParam:"style=simple,explode=false,name=object_id"` -} - -func (c CrmCustomObjectsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmCustomObjectsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmCustomObjectsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmCustomObjectsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCustomObjectsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmCustomObjectsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmCustomObjectsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmCustomObjectsOneRequest) GetObjectID() string { - if o == nil { - return "" - } - return o.ObjectID -} - -type CrmCustomObjectsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Custom object - GetCustomObjectResponse *components.GetCustomObjectResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmCustomObjectsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmCustomObjectsOneResponse) GetGetCustomObjectResponse() *components.GetCustomObjectResponse { - if o == nil { - return nil - } - return o.GetCustomObjectResponse -} - -func (o *CrmCustomObjectsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmcustomobjectsupdate.go b/tests/mockserver/internal/sdk/models/operations/crmcustomobjectsupdate.go deleted file mode 100644 index f43095d5..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmcustomobjectsupdate.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmCustomObjectsUpdateGlobals 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 *CrmCustomObjectsUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCustomObjectsUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmCustomObjectsUpdateRequest struct { - // ID of the record you are acting upon. - ID string `pathParam:"style=simple,explode=false,name=id"` - // The id of the custom object to query - ObjectID string `pathParam:"style=simple,explode=false,name=object_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"` - CustomObject components.CustomObjectInput `request:"mediaType=application/json"` -} - -func (c CrmCustomObjectsUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmCustomObjectsUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmCustomObjectsUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmCustomObjectsUpdateRequest) GetObjectID() string { - if o == nil { - return "" - } - return o.ObjectID -} - -func (o *CrmCustomObjectsUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmCustomObjectsUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmCustomObjectsUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmCustomObjectsUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmCustomObjectsUpdateRequest) GetCustomObject() components.CustomObjectInput { - if o == nil { - return components.CustomObjectInput{} - } - return o.CustomObject -} - -type CrmCustomObjectsUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Custom object updated - UpdateCustomObjectResponse *components.UpdateCustomObjectResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmCustomObjectsUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmCustomObjectsUpdateResponse) GetUpdateCustomObjectResponse() *components.UpdateCustomObjectResponse { - if o == nil { - return nil - } - return o.UpdateCustomObjectResponse -} - -func (o *CrmCustomObjectsUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmleadsadd.go b/tests/mockserver/internal/sdk/models/operations/crmleadsadd.go deleted file mode 100644 index 27a8f857..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmleadsadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmLeadsAddGlobals 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 *CrmLeadsAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmLeadsAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmLeadsAddRequest 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"` - Lead components.LeadInput `request:"mediaType=application/json"` -} - -func (c CrmLeadsAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmLeadsAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmLeadsAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmLeadsAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmLeadsAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmLeadsAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmLeadsAddRequest) GetLead() components.LeadInput { - if o == nil { - return components.LeadInput{} - } - return o.Lead -} - -type CrmLeadsAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Lead created - CreateLeadResponse *components.CreateLeadResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmLeadsAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmLeadsAddResponse) GetCreateLeadResponse() *components.CreateLeadResponse { - if o == nil { - return nil - } - return o.CreateLeadResponse -} - -func (o *CrmLeadsAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmleadsall.go b/tests/mockserver/internal/sdk/models/operations/crmleadsall.go deleted file mode 100644 index e5f3acb3..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmleadsall.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmLeadsAllGlobals 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 *CrmLeadsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmLeadsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmLeadsAllRequest 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.LeadsFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // Apply sorting - Sort *components.LeadsSort `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 (c CrmLeadsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmLeadsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmLeadsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmLeadsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmLeadsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmLeadsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmLeadsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *CrmLeadsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *CrmLeadsAllRequest) GetFilter() *components.LeadsFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *CrmLeadsAllRequest) GetSort() *components.LeadsSort { - if o == nil { - return nil - } - return o.Sort -} - -func (o *CrmLeadsAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *CrmLeadsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type CrmLeadsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Leads - GetLeadsResponse *components.GetLeadsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*CrmLeadsAllResponse, error) -} - -func (o *CrmLeadsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmLeadsAllResponse) GetGetLeadsResponse() *components.GetLeadsResponse { - if o == nil { - return nil - } - return o.GetLeadsResponse -} - -func (o *CrmLeadsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmleadsdelete.go b/tests/mockserver/internal/sdk/models/operations/crmleadsdelete.go deleted file mode 100644 index 6fab411c..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmleadsdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmLeadsDeleteGlobals 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 *CrmLeadsDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmLeadsDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmLeadsDeleteRequest 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 (c CrmLeadsDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmLeadsDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmLeadsDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmLeadsDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmLeadsDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmLeadsDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmLeadsDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type CrmLeadsDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Lead deleted - DeleteLeadResponse *components.DeleteLeadResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmLeadsDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmLeadsDeleteResponse) GetDeleteLeadResponse() *components.DeleteLeadResponse { - if o == nil { - return nil - } - return o.DeleteLeadResponse -} - -func (o *CrmLeadsDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmleadsone.go b/tests/mockserver/internal/sdk/models/operations/crmleadsone.go deleted file mode 100644 index 4095b439..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmleadsone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmLeadsOneGlobals 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 *CrmLeadsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmLeadsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmLeadsOneRequest 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 (c CrmLeadsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmLeadsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmLeadsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmLeadsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmLeadsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmLeadsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmLeadsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmLeadsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type CrmLeadsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Lead - GetLeadResponse *components.GetLeadResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmLeadsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmLeadsOneResponse) GetGetLeadResponse() *components.GetLeadResponse { - if o == nil { - return nil - } - return o.GetLeadResponse -} - -func (o *CrmLeadsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmleadsupdate.go b/tests/mockserver/internal/sdk/models/operations/crmleadsupdate.go deleted file mode 100644 index f98446e5..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmleadsupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmLeadsUpdateGlobals 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 *CrmLeadsUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmLeadsUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmLeadsUpdateRequest 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"` - Lead components.LeadInput `request:"mediaType=application/json"` -} - -func (c CrmLeadsUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmLeadsUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmLeadsUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmLeadsUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmLeadsUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmLeadsUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmLeadsUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmLeadsUpdateRequest) GetLead() components.LeadInput { - if o == nil { - return components.LeadInput{} - } - return o.Lead -} - -type CrmLeadsUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Lead updated - UpdateLeadResponse *components.UpdateLeadResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmLeadsUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmLeadsUpdateResponse) GetUpdateLeadResponse() *components.UpdateLeadResponse { - if o == nil { - return nil - } - return o.UpdateLeadResponse -} - -func (o *CrmLeadsUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmnotesadd.go b/tests/mockserver/internal/sdk/models/operations/crmnotesadd.go deleted file mode 100644 index e87e1e1e..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmnotesadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmNotesAddGlobals 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 *CrmNotesAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmNotesAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmNotesAddRequest 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"` - Note components.NoteInput `request:"mediaType=application/json"` -} - -func (c CrmNotesAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmNotesAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmNotesAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmNotesAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmNotesAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmNotesAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmNotesAddRequest) GetNote() components.NoteInput { - if o == nil { - return components.NoteInput{} - } - return o.Note -} - -type CrmNotesAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Note created - CreateNoteResponse *components.CreateNoteResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmNotesAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmNotesAddResponse) GetCreateNoteResponse() *components.CreateNoteResponse { - if o == nil { - return nil - } - return o.CreateNoteResponse -} - -func (o *CrmNotesAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmnotesall.go b/tests/mockserver/internal/sdk/models/operations/crmnotesall.go deleted file mode 100644 index d17c8109..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmnotesall.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmNotesAllGlobals 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 *CrmNotesAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmNotesAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmNotesAllRequest 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"` - // 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 (c CrmNotesAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmNotesAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmNotesAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmNotesAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmNotesAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmNotesAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmNotesAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *CrmNotesAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *CrmNotesAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *CrmNotesAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type CrmNotesAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Notes - GetNotesResponse *components.GetNotesResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*CrmNotesAllResponse, error) -} - -func (o *CrmNotesAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmNotesAllResponse) GetGetNotesResponse() *components.GetNotesResponse { - if o == nil { - return nil - } - return o.GetNotesResponse -} - -func (o *CrmNotesAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmnotesdelete.go b/tests/mockserver/internal/sdk/models/operations/crmnotesdelete.go deleted file mode 100644 index 2643adf0..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmnotesdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmNotesDeleteGlobals 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 *CrmNotesDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmNotesDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmNotesDeleteRequest 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 (c CrmNotesDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmNotesDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmNotesDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmNotesDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmNotesDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmNotesDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmNotesDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type CrmNotesDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Note deleted - DeleteNoteResponse *components.DeleteNoteResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmNotesDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmNotesDeleteResponse) GetDeleteNoteResponse() *components.DeleteNoteResponse { - if o == nil { - return nil - } - return o.DeleteNoteResponse -} - -func (o *CrmNotesDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmnotesone.go b/tests/mockserver/internal/sdk/models/operations/crmnotesone.go deleted file mode 100644 index 8775b11f..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmnotesone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmNotesOneGlobals 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 *CrmNotesOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmNotesOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmNotesOneRequest 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 (c CrmNotesOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmNotesOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmNotesOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmNotesOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmNotesOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmNotesOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmNotesOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmNotesOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type CrmNotesOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Note - GetNoteResponse *components.GetNoteResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmNotesOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmNotesOneResponse) GetGetNoteResponse() *components.GetNoteResponse { - if o == nil { - return nil - } - return o.GetNoteResponse -} - -func (o *CrmNotesOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmnotesupdate.go b/tests/mockserver/internal/sdk/models/operations/crmnotesupdate.go deleted file mode 100644 index bf87cae5..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmnotesupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmNotesUpdateGlobals 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 *CrmNotesUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmNotesUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmNotesUpdateRequest 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"` - Note components.NoteInput `request:"mediaType=application/json"` -} - -func (c CrmNotesUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmNotesUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmNotesUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmNotesUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmNotesUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmNotesUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmNotesUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmNotesUpdateRequest) GetNote() components.NoteInput { - if o == nil { - return components.NoteInput{} - } - return o.Note -} - -type CrmNotesUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Note updated - UpdateNoteResponse *components.UpdateNoteResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmNotesUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmNotesUpdateResponse) GetUpdateNoteResponse() *components.UpdateNoteResponse { - if o == nil { - return nil - } - return o.UpdateNoteResponse -} - -func (o *CrmNotesUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmopportunitiesadd.go b/tests/mockserver/internal/sdk/models/operations/crmopportunitiesadd.go deleted file mode 100644 index 43d0285d..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmopportunitiesadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmOpportunitiesAddGlobals 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 *CrmOpportunitiesAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmOpportunitiesAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmOpportunitiesAddRequest 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"` - Opportunity components.OpportunityInput `request:"mediaType=application/json"` -} - -func (c CrmOpportunitiesAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmOpportunitiesAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmOpportunitiesAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmOpportunitiesAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmOpportunitiesAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmOpportunitiesAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmOpportunitiesAddRequest) GetOpportunity() components.OpportunityInput { - if o == nil { - return components.OpportunityInput{} - } - return o.Opportunity -} - -type CrmOpportunitiesAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Opportunity created - CreateOpportunityResponse *components.CreateOpportunityResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmOpportunitiesAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmOpportunitiesAddResponse) GetCreateOpportunityResponse() *components.CreateOpportunityResponse { - if o == nil { - return nil - } - return o.CreateOpportunityResponse -} - -func (o *CrmOpportunitiesAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmopportunitiesall.go b/tests/mockserver/internal/sdk/models/operations/crmopportunitiesall.go deleted file mode 100644 index da249a8f..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmopportunitiesall.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmOpportunitiesAllGlobals 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 *CrmOpportunitiesAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmOpportunitiesAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmOpportunitiesAllRequest 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.OpportunitiesFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // Apply sorting - Sort *components.OpportunitiesSort `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 (c CrmOpportunitiesAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmOpportunitiesAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmOpportunitiesAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmOpportunitiesAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmOpportunitiesAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmOpportunitiesAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmOpportunitiesAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *CrmOpportunitiesAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *CrmOpportunitiesAllRequest) GetFilter() *components.OpportunitiesFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *CrmOpportunitiesAllRequest) GetSort() *components.OpportunitiesSort { - if o == nil { - return nil - } - return o.Sort -} - -func (o *CrmOpportunitiesAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *CrmOpportunitiesAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type CrmOpportunitiesAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Opportunities - GetOpportunitiesResponse *components.GetOpportunitiesResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*CrmOpportunitiesAllResponse, error) -} - -func (o *CrmOpportunitiesAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmOpportunitiesAllResponse) GetGetOpportunitiesResponse() *components.GetOpportunitiesResponse { - if o == nil { - return nil - } - return o.GetOpportunitiesResponse -} - -func (o *CrmOpportunitiesAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmopportunitiesdelete.go b/tests/mockserver/internal/sdk/models/operations/crmopportunitiesdelete.go deleted file mode 100644 index af7a70ff..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmopportunitiesdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmOpportunitiesDeleteGlobals 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 *CrmOpportunitiesDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmOpportunitiesDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmOpportunitiesDeleteRequest 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 (c CrmOpportunitiesDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmOpportunitiesDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmOpportunitiesDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmOpportunitiesDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmOpportunitiesDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmOpportunitiesDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmOpportunitiesDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type CrmOpportunitiesDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Opportunity deleted - DeleteOpportunityResponse *components.DeleteOpportunityResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmOpportunitiesDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmOpportunitiesDeleteResponse) GetDeleteOpportunityResponse() *components.DeleteOpportunityResponse { - if o == nil { - return nil - } - return o.DeleteOpportunityResponse -} - -func (o *CrmOpportunitiesDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmopportunitiesone.go b/tests/mockserver/internal/sdk/models/operations/crmopportunitiesone.go deleted file mode 100644 index bcf95dcb..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmopportunitiesone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmOpportunitiesOneGlobals 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 *CrmOpportunitiesOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmOpportunitiesOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmOpportunitiesOneRequest 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 (c CrmOpportunitiesOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmOpportunitiesOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmOpportunitiesOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmOpportunitiesOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmOpportunitiesOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmOpportunitiesOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmOpportunitiesOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmOpportunitiesOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type CrmOpportunitiesOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Opportunity - GetOpportunityResponse *components.GetOpportunityResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmOpportunitiesOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmOpportunitiesOneResponse) GetGetOpportunityResponse() *components.GetOpportunityResponse { - if o == nil { - return nil - } - return o.GetOpportunityResponse -} - -func (o *CrmOpportunitiesOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmopportunitiesupdate.go b/tests/mockserver/internal/sdk/models/operations/crmopportunitiesupdate.go deleted file mode 100644 index 8924d4f4..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmopportunitiesupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmOpportunitiesUpdateGlobals 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 *CrmOpportunitiesUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmOpportunitiesUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmOpportunitiesUpdateRequest 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"` - Opportunity components.OpportunityInput `request:"mediaType=application/json"` -} - -func (c CrmOpportunitiesUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmOpportunitiesUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmOpportunitiesUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmOpportunitiesUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmOpportunitiesUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmOpportunitiesUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmOpportunitiesUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmOpportunitiesUpdateRequest) GetOpportunity() components.OpportunityInput { - if o == nil { - return components.OpportunityInput{} - } - return o.Opportunity -} - -type CrmOpportunitiesUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Opportunity updated - UpdateOpportunityResponse *components.UpdateOpportunityResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmOpportunitiesUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmOpportunitiesUpdateResponse) GetUpdateOpportunityResponse() *components.UpdateOpportunityResponse { - if o == nil { - return nil - } - return o.UpdateOpportunityResponse -} - -func (o *CrmOpportunitiesUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmpipelinesadd.go b/tests/mockserver/internal/sdk/models/operations/crmpipelinesadd.go deleted file mode 100644 index 265acdd2..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmpipelinesadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmPipelinesAddGlobals 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 *CrmPipelinesAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmPipelinesAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmPipelinesAddRequest 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"` - Pipeline components.PipelineInput `request:"mediaType=application/json"` -} - -func (c CrmPipelinesAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmPipelinesAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmPipelinesAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmPipelinesAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmPipelinesAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmPipelinesAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmPipelinesAddRequest) GetPipeline() components.PipelineInput { - if o == nil { - return components.PipelineInput{} - } - return o.Pipeline -} - -type CrmPipelinesAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Pipeline created - CreatePipelineResponse *components.CreatePipelineResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmPipelinesAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmPipelinesAddResponse) GetCreatePipelineResponse() *components.CreatePipelineResponse { - if o == nil { - return nil - } - return o.CreatePipelineResponse -} - -func (o *CrmPipelinesAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmpipelinesall.go b/tests/mockserver/internal/sdk/models/operations/crmpipelinesall.go deleted file mode 100644 index ac7405da..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmpipelinesall.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmPipelinesAllGlobals 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 *CrmPipelinesAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmPipelinesAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmPipelinesAllRequest 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"` - // 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 (c CrmPipelinesAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmPipelinesAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmPipelinesAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmPipelinesAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmPipelinesAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmPipelinesAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmPipelinesAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *CrmPipelinesAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *CrmPipelinesAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *CrmPipelinesAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type CrmPipelinesAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Pipelines - GetPipelinesResponse *components.GetPipelinesResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*CrmPipelinesAllResponse, error) -} - -func (o *CrmPipelinesAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmPipelinesAllResponse) GetGetPipelinesResponse() *components.GetPipelinesResponse { - if o == nil { - return nil - } - return o.GetPipelinesResponse -} - -func (o *CrmPipelinesAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmpipelinesdelete.go b/tests/mockserver/internal/sdk/models/operations/crmpipelinesdelete.go deleted file mode 100644 index f30e9370..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmpipelinesdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmPipelinesDeleteGlobals 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 *CrmPipelinesDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmPipelinesDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmPipelinesDeleteRequest 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 (c CrmPipelinesDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmPipelinesDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmPipelinesDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmPipelinesDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmPipelinesDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmPipelinesDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmPipelinesDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type CrmPipelinesDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Pipeline deleted - DeletePipelineResponse *components.DeletePipelineResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmPipelinesDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmPipelinesDeleteResponse) GetDeletePipelineResponse() *components.DeletePipelineResponse { - if o == nil { - return nil - } - return o.DeletePipelineResponse -} - -func (o *CrmPipelinesDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmpipelinesone.go b/tests/mockserver/internal/sdk/models/operations/crmpipelinesone.go deleted file mode 100644 index a88bee70..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmpipelinesone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmPipelinesOneGlobals 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 *CrmPipelinesOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmPipelinesOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmPipelinesOneRequest 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 (c CrmPipelinesOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmPipelinesOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmPipelinesOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmPipelinesOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmPipelinesOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmPipelinesOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmPipelinesOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmPipelinesOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type CrmPipelinesOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Pipeline - GetPipelineResponse *components.GetPipelineResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmPipelinesOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmPipelinesOneResponse) GetGetPipelineResponse() *components.GetPipelineResponse { - if o == nil { - return nil - } - return o.GetPipelineResponse -} - -func (o *CrmPipelinesOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmpipelinesupdate.go b/tests/mockserver/internal/sdk/models/operations/crmpipelinesupdate.go deleted file mode 100644 index 53977e59..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmpipelinesupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmPipelinesUpdateGlobals 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 *CrmPipelinesUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmPipelinesUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmPipelinesUpdateRequest 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"` - Pipeline components.PipelineInput `request:"mediaType=application/json"` -} - -func (c CrmPipelinesUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmPipelinesUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmPipelinesUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmPipelinesUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmPipelinesUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmPipelinesUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmPipelinesUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmPipelinesUpdateRequest) GetPipeline() components.PipelineInput { - if o == nil { - return components.PipelineInput{} - } - return o.Pipeline -} - -type CrmPipelinesUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Pipeline updated - UpdatePipelineResponse *components.UpdatePipelineResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmPipelinesUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmPipelinesUpdateResponse) GetUpdatePipelineResponse() *components.UpdatePipelineResponse { - if o == nil { - return nil - } - return o.UpdatePipelineResponse -} - -func (o *CrmPipelinesUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmusersadd.go b/tests/mockserver/internal/sdk/models/operations/crmusersadd.go deleted file mode 100644 index ba26ea33..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmusersadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmUsersAddGlobals 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 *CrmUsersAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmUsersAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmUsersAddRequest 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"` - User components.UserInput `request:"mediaType=application/json"` -} - -func (c CrmUsersAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmUsersAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmUsersAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmUsersAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmUsersAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmUsersAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmUsersAddRequest) GetUser() components.UserInput { - if o == nil { - return components.UserInput{} - } - return o.User -} - -type CrmUsersAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // User created - CreateUserResponse *components.CreateUserResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmUsersAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmUsersAddResponse) GetCreateUserResponse() *components.CreateUserResponse { - if o == nil { - return nil - } - return o.CreateUserResponse -} - -func (o *CrmUsersAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmusersall.go b/tests/mockserver/internal/sdk/models/operations/crmusersall.go deleted file mode 100644 index 884d2d4e..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmusersall.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmUsersAllGlobals 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 *CrmUsersAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmUsersAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmUsersAllRequest 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"` - // 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 (c CrmUsersAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmUsersAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmUsersAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmUsersAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmUsersAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmUsersAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmUsersAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *CrmUsersAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *CrmUsersAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *CrmUsersAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type CrmUsersAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Users - GetUsersResponse *components.GetUsersResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*CrmUsersAllResponse, error) -} - -func (o *CrmUsersAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmUsersAllResponse) GetGetUsersResponse() *components.GetUsersResponse { - if o == nil { - return nil - } - return o.GetUsersResponse -} - -func (o *CrmUsersAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmusersdelete.go b/tests/mockserver/internal/sdk/models/operations/crmusersdelete.go deleted file mode 100644 index 74bc2097..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmusersdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmUsersDeleteGlobals 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 *CrmUsersDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmUsersDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmUsersDeleteRequest 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 (c CrmUsersDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmUsersDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmUsersDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmUsersDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmUsersDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmUsersDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmUsersDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type CrmUsersDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // User deleted - DeleteUserResponse *components.DeleteUserResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmUsersDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmUsersDeleteResponse) GetDeleteUserResponse() *components.DeleteUserResponse { - if o == nil { - return nil - } - return o.DeleteUserResponse -} - -func (o *CrmUsersDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmusersone.go b/tests/mockserver/internal/sdk/models/operations/crmusersone.go deleted file mode 100644 index 0311312c..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmusersone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmUsersOneGlobals 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 *CrmUsersOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmUsersOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmUsersOneRequest 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 (c CrmUsersOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmUsersOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmUsersOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmUsersOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmUsersOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmUsersOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmUsersOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmUsersOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type CrmUsersOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // User - GetUserResponse *components.GetUserResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmUsersOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmUsersOneResponse) GetGetUserResponse() *components.GetUserResponse { - if o == nil { - return nil - } - return o.GetUserResponse -} - -func (o *CrmUsersOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/crmusersupdate.go b/tests/mockserver/internal/sdk/models/operations/crmusersupdate.go deleted file mode 100644 index 6837237a..00000000 --- a/tests/mockserver/internal/sdk/models/operations/crmusersupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type CrmUsersUpdateGlobals 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 *CrmUsersUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmUsersUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type CrmUsersUpdateRequest 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"` - User components.UserInput `request:"mediaType=application/json"` -} - -func (c CrmUsersUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *CrmUsersUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil -} - -func (o *CrmUsersUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *CrmUsersUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *CrmUsersUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *CrmUsersUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *CrmUsersUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *CrmUsersUpdateRequest) GetUser() components.UserInput { - if o == nil { - return components.UserInput{} - } - return o.User -} - -type CrmUsersUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // User updated - UpdateUserResponse *components.UpdateUserResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *CrmUsersUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *CrmUsersUpdateResponse) GetUpdateUserResponse() *components.UpdateUserResponse { - if o == nil { - return nil - } - return o.UpdateUserResponse -} - -func (o *CrmUsersUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/ecommercecustomersall.go b/tests/mockserver/internal/sdk/models/operations/ecommercecustomersall.go deleted file mode 100644 index 39d04118..00000000 --- a/tests/mockserver/internal/sdk/models/operations/ecommercecustomersall.go +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type EcommerceCustomersAllGlobals 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 *EcommerceCustomersAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *EcommerceCustomersAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type EcommerceCustomersAllRequest 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.EcommerceCustomersFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // 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 (e EcommerceCustomersAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(e, "", false) -} - -func (e *EcommerceCustomersAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { - return err - } - return nil -} - -func (o *EcommerceCustomersAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *EcommerceCustomersAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *EcommerceCustomersAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *EcommerceCustomersAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *EcommerceCustomersAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *EcommerceCustomersAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *EcommerceCustomersAllRequest) GetFilter() *components.EcommerceCustomersFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *EcommerceCustomersAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *EcommerceCustomersAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type EcommerceCustomersAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Customers - GetEcommerceCustomersResponse *components.GetEcommerceCustomersResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*EcommerceCustomersAllResponse, error) -} - -func (o *EcommerceCustomersAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *EcommerceCustomersAllResponse) GetGetEcommerceCustomersResponse() *components.GetEcommerceCustomersResponse { - if o == nil { - return nil - } - return o.GetEcommerceCustomersResponse -} - -func (o *EcommerceCustomersAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/ecommercecustomersone.go b/tests/mockserver/internal/sdk/models/operations/ecommercecustomersone.go deleted file mode 100644 index b4c76f72..00000000 --- a/tests/mockserver/internal/sdk/models/operations/ecommercecustomersone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type EcommerceCustomersOneGlobals 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 *EcommerceCustomersOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *EcommerceCustomersOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type EcommerceCustomersOneRequest 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 (e EcommerceCustomersOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(e, "", false) -} - -func (e *EcommerceCustomersOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { - return err - } - return nil -} - -func (o *EcommerceCustomersOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *EcommerceCustomersOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *EcommerceCustomersOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *EcommerceCustomersOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *EcommerceCustomersOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *EcommerceCustomersOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type EcommerceCustomersOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Customers - GetEcommerceCustomerResponse *components.GetEcommerceCustomerResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *EcommerceCustomersOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *EcommerceCustomersOneResponse) GetGetEcommerceCustomerResponse() *components.GetEcommerceCustomerResponse { - if o == nil { - return nil - } - return o.GetEcommerceCustomerResponse -} - -func (o *EcommerceCustomersOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/ecommerceordersall.go b/tests/mockserver/internal/sdk/models/operations/ecommerceordersall.go deleted file mode 100644 index 8293aa68..00000000 --- a/tests/mockserver/internal/sdk/models/operations/ecommerceordersall.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type EcommerceOrdersAllGlobals 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 *EcommerceOrdersAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *EcommerceOrdersAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type EcommerceOrdersAllRequest 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.EcommerceOrdersFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // Apply sorting - Sort *components.OrdersSort `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 (e EcommerceOrdersAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(e, "", false) -} - -func (e *EcommerceOrdersAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { - return err - } - return nil -} - -func (o *EcommerceOrdersAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *EcommerceOrdersAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *EcommerceOrdersAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *EcommerceOrdersAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *EcommerceOrdersAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *EcommerceOrdersAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *EcommerceOrdersAllRequest) GetFilter() *components.EcommerceOrdersFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *EcommerceOrdersAllRequest) GetSort() *components.OrdersSort { - if o == nil { - return nil - } - return o.Sort -} - -func (o *EcommerceOrdersAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *EcommerceOrdersAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type EcommerceOrdersAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Orders - GetEcommerceOrdersResponse *components.GetEcommerceOrdersResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*EcommerceOrdersAllResponse, error) -} - -func (o *EcommerceOrdersAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *EcommerceOrdersAllResponse) GetGetEcommerceOrdersResponse() *components.GetEcommerceOrdersResponse { - if o == nil { - return nil - } - return o.GetEcommerceOrdersResponse -} - -func (o *EcommerceOrdersAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/ecommerceordersone.go b/tests/mockserver/internal/sdk/models/operations/ecommerceordersone.go deleted file mode 100644 index 02bf25ed..00000000 --- a/tests/mockserver/internal/sdk/models/operations/ecommerceordersone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type EcommerceOrdersOneGlobals 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 *EcommerceOrdersOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *EcommerceOrdersOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type EcommerceOrdersOneRequest 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 (e EcommerceOrdersOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(e, "", false) -} - -func (e *EcommerceOrdersOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { - return err - } - return nil -} - -func (o *EcommerceOrdersOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *EcommerceOrdersOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *EcommerceOrdersOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *EcommerceOrdersOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *EcommerceOrdersOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *EcommerceOrdersOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type EcommerceOrdersOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Orders - GetEcommerceOrderResponse *components.GetEcommerceOrderResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *EcommerceOrdersOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *EcommerceOrdersOneResponse) GetGetEcommerceOrderResponse() *components.GetEcommerceOrderResponse { - if o == nil { - return nil - } - return o.GetEcommerceOrderResponse -} - -func (o *EcommerceOrdersOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/ecommerceproductsall.go b/tests/mockserver/internal/sdk/models/operations/ecommerceproductsall.go deleted file mode 100644 index 1a1523cd..00000000 --- a/tests/mockserver/internal/sdk/models/operations/ecommerceproductsall.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type EcommerceProductsAllGlobals 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 *EcommerceProductsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *EcommerceProductsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type EcommerceProductsAllRequest 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"` - // 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 (e EcommerceProductsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(e, "", false) -} - -func (e *EcommerceProductsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { - return err - } - return nil -} - -func (o *EcommerceProductsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *EcommerceProductsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *EcommerceProductsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *EcommerceProductsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *EcommerceProductsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *EcommerceProductsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *EcommerceProductsAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *EcommerceProductsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type EcommerceProductsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Products - GetProductsResponse *components.GetProductsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*EcommerceProductsAllResponse, error) -} - -func (o *EcommerceProductsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *EcommerceProductsAllResponse) GetGetProductsResponse() *components.GetProductsResponse { - if o == nil { - return nil - } - return o.GetProductsResponse -} - -func (o *EcommerceProductsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/ecommerceproductsone.go b/tests/mockserver/internal/sdk/models/operations/ecommerceproductsone.go deleted file mode 100644 index fb75d63f..00000000 --- a/tests/mockserver/internal/sdk/models/operations/ecommerceproductsone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type EcommerceProductsOneGlobals 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 *EcommerceProductsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *EcommerceProductsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type EcommerceProductsOneRequest 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 (e EcommerceProductsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(e, "", false) -} - -func (e *EcommerceProductsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { - return err - } - return nil -} - -func (o *EcommerceProductsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *EcommerceProductsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *EcommerceProductsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *EcommerceProductsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *EcommerceProductsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *EcommerceProductsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type EcommerceProductsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Products - GetProductResponse *components.GetProductResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *EcommerceProductsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *EcommerceProductsOneResponse) GetGetProductResponse() *components.GetProductResponse { - if o == nil { - return nil - } - return o.GetProductResponse -} - -func (o *EcommerceProductsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/ecommercestoresone.go b/tests/mockserver/internal/sdk/models/operations/ecommercestoresone.go deleted file mode 100644 index c3624e8a..00000000 --- a/tests/mockserver/internal/sdk/models/operations/ecommercestoresone.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type EcommerceStoresOneGlobals 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 *EcommerceStoresOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *EcommerceStoresOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type EcommerceStoresOneRequest 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"` - // 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 (e EcommerceStoresOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(e, "", false) -} - -func (e *EcommerceStoresOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &e, "", false, false); err != nil { - return err - } - return nil -} - -func (o *EcommerceStoresOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *EcommerceStoresOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *EcommerceStoresOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *EcommerceStoresOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *EcommerceStoresOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type EcommerceStoresOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Stores - GetStoreResponse *components.GetStoreResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *EcommerceStoresOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *EcommerceStoresOneResponse) GetGetStoreResponse() *components.GetStoreResponse { - if o == nil { - return nil - } - return o.GetStoreResponse -} - -func (o *EcommerceStoresOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragedrivegroupsadd.go b/tests/mockserver/internal/sdk/models/operations/filestoragedrivegroupsadd.go deleted file mode 100644 index 8ec8ae91..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragedrivegroupsadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageDriveGroupsAddGlobals 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 *FileStorageDriveGroupsAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageDriveGroupsAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageDriveGroupsAddRequest 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"` - DriveGroup components.DriveGroupInput `request:"mediaType=application/json"` -} - -func (f FileStorageDriveGroupsAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageDriveGroupsAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageDriveGroupsAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageDriveGroupsAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageDriveGroupsAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageDriveGroupsAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageDriveGroupsAddRequest) GetDriveGroup() components.DriveGroupInput { - if o == nil { - return components.DriveGroupInput{} - } - return o.DriveGroup -} - -type FileStorageDriveGroupsAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // DriveGroups - CreateDriveGroupResponse *components.CreateDriveGroupResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageDriveGroupsAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageDriveGroupsAddResponse) GetCreateDriveGroupResponse() *components.CreateDriveGroupResponse { - if o == nil { - return nil - } - return o.CreateDriveGroupResponse -} - -func (o *FileStorageDriveGroupsAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragedrivegroupsall.go b/tests/mockserver/internal/sdk/models/operations/filestoragedrivegroupsall.go deleted file mode 100644 index c2c5bfe4..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragedrivegroupsall.go +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageDriveGroupsAllGlobals 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 *FileStorageDriveGroupsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageDriveGroupsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageDriveGroupsAllRequest 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.DriveGroupsFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // 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 (f FileStorageDriveGroupsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageDriveGroupsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageDriveGroupsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageDriveGroupsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageDriveGroupsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageDriveGroupsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageDriveGroupsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *FileStorageDriveGroupsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *FileStorageDriveGroupsAllRequest) GetFilter() *components.DriveGroupsFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *FileStorageDriveGroupsAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *FileStorageDriveGroupsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type FileStorageDriveGroupsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // DriveGroups - GetDriveGroupsResponse *components.GetDriveGroupsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*FileStorageDriveGroupsAllResponse, error) -} - -func (o *FileStorageDriveGroupsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageDriveGroupsAllResponse) GetGetDriveGroupsResponse() *components.GetDriveGroupsResponse { - if o == nil { - return nil - } - return o.GetDriveGroupsResponse -} - -func (o *FileStorageDriveGroupsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragedrivegroupsdelete.go b/tests/mockserver/internal/sdk/models/operations/filestoragedrivegroupsdelete.go deleted file mode 100644 index a2abd30d..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragedrivegroupsdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageDriveGroupsDeleteGlobals 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 *FileStorageDriveGroupsDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageDriveGroupsDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageDriveGroupsDeleteRequest 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 (f FileStorageDriveGroupsDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageDriveGroupsDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageDriveGroupsDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *FileStorageDriveGroupsDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageDriveGroupsDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageDriveGroupsDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageDriveGroupsDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type FileStorageDriveGroupsDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // DriveGroups - DeleteDriveGroupResponse *components.DeleteDriveGroupResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageDriveGroupsDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageDriveGroupsDeleteResponse) GetDeleteDriveGroupResponse() *components.DeleteDriveGroupResponse { - if o == nil { - return nil - } - return o.DeleteDriveGroupResponse -} - -func (o *FileStorageDriveGroupsDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragedrivegroupsone.go b/tests/mockserver/internal/sdk/models/operations/filestoragedrivegroupsone.go deleted file mode 100644 index d486de3b..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragedrivegroupsone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageDriveGroupsOneGlobals 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 *FileStorageDriveGroupsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageDriveGroupsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageDriveGroupsOneRequest 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 (f FileStorageDriveGroupsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageDriveGroupsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageDriveGroupsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *FileStorageDriveGroupsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageDriveGroupsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageDriveGroupsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageDriveGroupsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageDriveGroupsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type FileStorageDriveGroupsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // DriveGroups - GetDriveGroupResponse *components.GetDriveGroupResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageDriveGroupsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageDriveGroupsOneResponse) GetGetDriveGroupResponse() *components.GetDriveGroupResponse { - if o == nil { - return nil - } - return o.GetDriveGroupResponse -} - -func (o *FileStorageDriveGroupsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragedrivegroupsupdate.go b/tests/mockserver/internal/sdk/models/operations/filestoragedrivegroupsupdate.go deleted file mode 100644 index c34ecd56..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragedrivegroupsupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageDriveGroupsUpdateGlobals 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 *FileStorageDriveGroupsUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageDriveGroupsUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageDriveGroupsUpdateRequest 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"` - DriveGroup components.DriveGroupInput `request:"mediaType=application/json"` -} - -func (f FileStorageDriveGroupsUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageDriveGroupsUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageDriveGroupsUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *FileStorageDriveGroupsUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageDriveGroupsUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageDriveGroupsUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageDriveGroupsUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageDriveGroupsUpdateRequest) GetDriveGroup() components.DriveGroupInput { - if o == nil { - return components.DriveGroupInput{} - } - return o.DriveGroup -} - -type FileStorageDriveGroupsUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // DriveGroups - UpdateDriveGroupResponse *components.UpdateDriveGroupResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageDriveGroupsUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageDriveGroupsUpdateResponse) GetUpdateDriveGroupResponse() *components.UpdateDriveGroupResponse { - if o == nil { - return nil - } - return o.UpdateDriveGroupResponse -} - -func (o *FileStorageDriveGroupsUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragedrivesadd.go b/tests/mockserver/internal/sdk/models/operations/filestoragedrivesadd.go deleted file mode 100644 index 8055be81..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragedrivesadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageDrivesAddGlobals 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 *FileStorageDrivesAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageDrivesAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageDrivesAddRequest 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"` - Drive components.DriveInput `request:"mediaType=application/json"` -} - -func (f FileStorageDrivesAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageDrivesAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageDrivesAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageDrivesAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageDrivesAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageDrivesAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageDrivesAddRequest) GetDrive() components.DriveInput { - if o == nil { - return components.DriveInput{} - } - return o.Drive -} - -type FileStorageDrivesAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Drives - CreateDriveResponse *components.CreateDriveResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageDrivesAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageDrivesAddResponse) GetCreateDriveResponse() *components.CreateDriveResponse { - if o == nil { - return nil - } - return o.CreateDriveResponse -} - -func (o *FileStorageDrivesAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragedrivesall.go b/tests/mockserver/internal/sdk/models/operations/filestoragedrivesall.go deleted file mode 100644 index 453e5437..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragedrivesall.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageDrivesAllGlobals 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 *FileStorageDrivesAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageDrivesAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageDrivesAllRequest 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.DrivesFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // 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 (f FileStorageDrivesAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageDrivesAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageDrivesAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageDrivesAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageDrivesAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageDrivesAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageDrivesAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *FileStorageDrivesAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *FileStorageDrivesAllRequest) GetFilter() *components.DrivesFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *FileStorageDrivesAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type FileStorageDrivesAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Drives - GetDrivesResponse *components.GetDrivesResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*FileStorageDrivesAllResponse, error) -} - -func (o *FileStorageDrivesAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageDrivesAllResponse) GetGetDrivesResponse() *components.GetDrivesResponse { - if o == nil { - return nil - } - return o.GetDrivesResponse -} - -func (o *FileStorageDrivesAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragedrivesdelete.go b/tests/mockserver/internal/sdk/models/operations/filestoragedrivesdelete.go deleted file mode 100644 index 0b3331da..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragedrivesdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageDrivesDeleteGlobals 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 *FileStorageDrivesDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageDrivesDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageDrivesDeleteRequest 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 (f FileStorageDrivesDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageDrivesDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageDrivesDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *FileStorageDrivesDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageDrivesDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageDrivesDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageDrivesDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type FileStorageDrivesDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Drives - DeleteDriveResponse *components.DeleteDriveResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageDrivesDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageDrivesDeleteResponse) GetDeleteDriveResponse() *components.DeleteDriveResponse { - if o == nil { - return nil - } - return o.DeleteDriveResponse -} - -func (o *FileStorageDrivesDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragedrivesone.go b/tests/mockserver/internal/sdk/models/operations/filestoragedrivesone.go deleted file mode 100644 index 828ef47d..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragedrivesone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageDrivesOneGlobals 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 *FileStorageDrivesOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageDrivesOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageDrivesOneRequest 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 (f FileStorageDrivesOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageDrivesOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageDrivesOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *FileStorageDrivesOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageDrivesOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageDrivesOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageDrivesOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageDrivesOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type FileStorageDrivesOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Drives - GetDriveResponse *components.GetDriveResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageDrivesOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageDrivesOneResponse) GetGetDriveResponse() *components.GetDriveResponse { - if o == nil { - return nil - } - return o.GetDriveResponse -} - -func (o *FileStorageDrivesOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragedrivesupdate.go b/tests/mockserver/internal/sdk/models/operations/filestoragedrivesupdate.go deleted file mode 100644 index d776d485..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragedrivesupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageDrivesUpdateGlobals 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 *FileStorageDrivesUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageDrivesUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageDrivesUpdateRequest 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"` - Drive components.DriveInput `request:"mediaType=application/json"` -} - -func (f FileStorageDrivesUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageDrivesUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageDrivesUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *FileStorageDrivesUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageDrivesUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageDrivesUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageDrivesUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageDrivesUpdateRequest) GetDrive() components.DriveInput { - if o == nil { - return components.DriveInput{} - } - return o.Drive -} - -type FileStorageDrivesUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Drives - UpdateDriveResponse *components.UpdateDriveResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageDrivesUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageDrivesUpdateResponse) GetUpdateDriveResponse() *components.UpdateDriveResponse { - if o == nil { - return nil - } - return o.UpdateDriveResponse -} - -func (o *FileStorageDrivesUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragefilesall.go b/tests/mockserver/internal/sdk/models/operations/filestoragefilesall.go deleted file mode 100644 index 7449a2a4..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragefilesall.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageFilesAllGlobals 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 *FileStorageFilesAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFilesAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageFilesAllRequest 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.FilesFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // Apply sorting - Sort *components.FilesSort `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 (f FileStorageFilesAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageFilesAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageFilesAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageFilesAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFilesAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageFilesAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageFilesAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *FileStorageFilesAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *FileStorageFilesAllRequest) GetFilter() *components.FilesFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *FileStorageFilesAllRequest) GetSort() *components.FilesSort { - if o == nil { - return nil - } - return o.Sort -} - -func (o *FileStorageFilesAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *FileStorageFilesAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type FileStorageFilesAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Files - GetFilesResponse *components.GetFilesResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*FileStorageFilesAllResponse, error) -} - -func (o *FileStorageFilesAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageFilesAllResponse) GetGetFilesResponse() *components.GetFilesResponse { - if o == nil { - return nil - } - return o.GetFilesResponse -} - -func (o *FileStorageFilesAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragefilesdelete.go b/tests/mockserver/internal/sdk/models/operations/filestoragefilesdelete.go deleted file mode 100644 index 525f1fca..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragefilesdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageFilesDeleteGlobals 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 *FileStorageFilesDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFilesDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageFilesDeleteRequest 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 (f FileStorageFilesDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageFilesDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageFilesDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *FileStorageFilesDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFilesDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageFilesDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageFilesDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type FileStorageFilesDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Files - DeleteFileResponse *components.DeleteFileResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageFilesDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageFilesDeleteResponse) GetDeleteFileResponse() *components.DeleteFileResponse { - if o == nil { - return nil - } - return o.DeleteFileResponse -} - -func (o *FileStorageFilesDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragefilesdownload.go b/tests/mockserver/internal/sdk/models/operations/filestoragefilesdownload.go deleted file mode 100644 index b5e81468..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragefilesdownload.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "io" - "mockserver/internal/sdk/models/components" -) - -type FileStorageFilesDownloadGlobals 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 *FileStorageFilesDownloadGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFilesDownloadGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageFilesDownloadRequest 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"` - // 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 (o *FileStorageFilesDownloadRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *FileStorageFilesDownloadRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFilesDownloadRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageFilesDownloadRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageFilesDownloadRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type FileStorageFilesDownloadResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // File Download - // The Close method must be called on this field, even if it is not used, to prevent resource leaks. - GetFileDownloadResponse io.ReadCloser - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageFilesDownloadResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageFilesDownloadResponse) GetGetFileDownloadResponse() io.ReadCloser { - if o == nil { - return nil - } - return o.GetFileDownloadResponse -} - -func (o *FileStorageFilesDownloadResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragefilesexport.go b/tests/mockserver/internal/sdk/models/operations/filestoragefilesexport.go deleted file mode 100644 index 12fc64eb..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragefilesexport.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "io" - "mockserver/internal/sdk/models/components" -) - -type FileStorageFilesExportGlobals 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 *FileStorageFilesExportGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFilesExportGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageFilesExportRequest 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"` - // 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"` - // File format to export this file to. A list of available file formats for the current file is available as `export_formats` on the File resource. - FileFormat string `queryParam:"style=form,explode=true,name=format"` -} - -func (o *FileStorageFilesExportRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *FileStorageFilesExportRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFilesExportRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageFilesExportRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageFilesExportRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -func (o *FileStorageFilesExportRequest) GetFileFormat() string { - if o == nil { - return "" - } - return o.FileFormat -} - -type FileStorageFilesExportResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // File Download - // The Close method must be called on this field, even if it is not used, to prevent resource leaks. - GetFileDownloadResponse io.ReadCloser - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageFilesExportResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageFilesExportResponse) GetGetFileDownloadResponse() io.ReadCloser { - if o == nil { - return nil - } - return o.GetFileDownloadResponse -} - -func (o *FileStorageFilesExportResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragefilesone.go b/tests/mockserver/internal/sdk/models/operations/filestoragefilesone.go deleted file mode 100644 index 63e7ed8d..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragefilesone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageFilesOneGlobals 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 *FileStorageFilesOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFilesOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageFilesOneRequest 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 (f FileStorageFilesOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageFilesOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageFilesOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *FileStorageFilesOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFilesOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageFilesOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageFilesOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageFilesOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type FileStorageFilesOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // File - GetFileResponse *components.GetFileResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageFilesOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageFilesOneResponse) GetGetFileResponse() *components.GetFileResponse { - if o == nil { - return nil - } - return o.GetFileResponse -} - -func (o *FileStorageFilesOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragefilessearch.go b/tests/mockserver/internal/sdk/models/operations/filestoragefilessearch.go deleted file mode 100644 index ad65d2d6..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragefilessearch.go +++ /dev/null @@ -1,161 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageFilesSearchGlobals 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 *FileStorageFilesSearchGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFilesSearchGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageFilesSearchRequest 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"` - // 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"` - // 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"` - // 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"` - // Include raw response. Mostly used for debugging purposes - Raw *bool `default:"false" queryParam:"style=form,explode=true,name=raw"` - // Apply filters - Filter *components.FilesFilter `queryParam:"style=deepObject,explode=true,name=filter"` - FilesSearch components.FilesSearch `request:"mediaType=application/json"` -} - -func (f FileStorageFilesSearchRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageFilesSearchRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageFilesSearchRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFilesSearchRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageFilesSearchRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageFilesSearchRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *FileStorageFilesSearchRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -func (o *FileStorageFilesSearchRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *FileStorageFilesSearchRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *FileStorageFilesSearchRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageFilesSearchRequest) GetFilter() *components.FilesFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *FileStorageFilesSearchRequest) GetFilesSearch() components.FilesSearch { - if o == nil { - return components.FilesSearch{} - } - return o.FilesSearch -} - -type FileStorageFilesSearchResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Files - GetFilesResponse *components.GetFilesResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageFilesSearchResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageFilesSearchResponse) GetGetFilesResponse() *components.GetFilesResponse { - if o == nil { - return nil - } - return o.GetFilesResponse -} - -func (o *FileStorageFilesSearchResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragefilesupdate.go b/tests/mockserver/internal/sdk/models/operations/filestoragefilesupdate.go deleted file mode 100644 index 0b029102..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragefilesupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageFilesUpdateGlobals 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 *FileStorageFilesUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFilesUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageFilesUpdateRequest 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"` - UpdateFileRequest components.UpdateFileRequest `request:"mediaType=application/json"` -} - -func (f FileStorageFilesUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageFilesUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageFilesUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *FileStorageFilesUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFilesUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageFilesUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageFilesUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageFilesUpdateRequest) GetUpdateFileRequest() components.UpdateFileRequest { - if o == nil { - return components.UpdateFileRequest{} - } - return o.UpdateFileRequest -} - -type FileStorageFilesUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Files - UpdateFileResponse *components.UpdateFileResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageFilesUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageFilesUpdateResponse) GetUpdateFileResponse() *components.UpdateFileResponse { - if o == nil { - return nil - } - return o.UpdateFileResponse -} - -func (o *FileStorageFilesUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragefoldersadd.go b/tests/mockserver/internal/sdk/models/operations/filestoragefoldersadd.go deleted file mode 100644 index 35b2b458..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragefoldersadd.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageFoldersAddGlobals 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 *FileStorageFoldersAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFoldersAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageFoldersAddRequest 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"` - // 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"` - CreateFolderRequest components.CreateFolderRequest `request:"mediaType=application/json"` -} - -func (f FileStorageFoldersAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageFoldersAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageFoldersAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageFoldersAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFoldersAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageFoldersAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageFoldersAddRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -func (o *FileStorageFoldersAddRequest) GetCreateFolderRequest() components.CreateFolderRequest { - if o == nil { - return components.CreateFolderRequest{} - } - return o.CreateFolderRequest -} - -type FileStorageFoldersAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Folders - CreateFolderResponse *components.CreateFolderResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageFoldersAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageFoldersAddResponse) GetCreateFolderResponse() *components.CreateFolderResponse { - if o == nil { - return nil - } - return o.CreateFolderResponse -} - -func (o *FileStorageFoldersAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragefolderscopy.go b/tests/mockserver/internal/sdk/models/operations/filestoragefolderscopy.go deleted file mode 100644 index 2ff278aa..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragefolderscopy.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageFoldersCopyGlobals 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 *FileStorageFoldersCopyGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFoldersCopyGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageFoldersCopyRequest 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"` - CopyFolderRequest components.CopyFolderRequest `request:"mediaType=application/json"` -} - -func (f FileStorageFoldersCopyRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageFoldersCopyRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageFoldersCopyRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *FileStorageFoldersCopyRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFoldersCopyRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageFoldersCopyRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageFoldersCopyRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageFoldersCopyRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -func (o *FileStorageFoldersCopyRequest) GetCopyFolderRequest() components.CopyFolderRequest { - if o == nil { - return components.CopyFolderRequest{} - } - return o.CopyFolderRequest -} - -type FileStorageFoldersCopyResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Folders - UpdateFolderResponse *components.UpdateFolderResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageFoldersCopyResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageFoldersCopyResponse) GetUpdateFolderResponse() *components.UpdateFolderResponse { - if o == nil { - return nil - } - return o.UpdateFolderResponse -} - -func (o *FileStorageFoldersCopyResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragefoldersdelete.go b/tests/mockserver/internal/sdk/models/operations/filestoragefoldersdelete.go deleted file mode 100644 index 78faae4c..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragefoldersdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageFoldersDeleteGlobals 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 *FileStorageFoldersDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFoldersDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageFoldersDeleteRequest 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 (f FileStorageFoldersDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageFoldersDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageFoldersDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *FileStorageFoldersDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFoldersDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageFoldersDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageFoldersDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type FileStorageFoldersDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Folders - DeleteFolderResponse *components.DeleteFolderResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageFoldersDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageFoldersDeleteResponse) GetDeleteFolderResponse() *components.DeleteFolderResponse { - if o == nil { - return nil - } - return o.DeleteFolderResponse -} - -func (o *FileStorageFoldersDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragefoldersone.go b/tests/mockserver/internal/sdk/models/operations/filestoragefoldersone.go deleted file mode 100644 index f1a2dbca..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragefoldersone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageFoldersOneGlobals 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 *FileStorageFoldersOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFoldersOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageFoldersOneRequest 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 (f FileStorageFoldersOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageFoldersOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageFoldersOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *FileStorageFoldersOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFoldersOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageFoldersOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageFoldersOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageFoldersOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type FileStorageFoldersOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Folders - GetFolderResponse *components.GetFolderResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageFoldersOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageFoldersOneResponse) GetGetFolderResponse() *components.GetFolderResponse { - if o == nil { - return nil - } - return o.GetFolderResponse -} - -func (o *FileStorageFoldersOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragefoldersupdate.go b/tests/mockserver/internal/sdk/models/operations/filestoragefoldersupdate.go deleted file mode 100644 index d78c1a53..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragefoldersupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageFoldersUpdateGlobals 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 *FileStorageFoldersUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFoldersUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageFoldersUpdateRequest 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"` - UpdateFolderRequest components.UpdateFolderRequest `request:"mediaType=application/json"` -} - -func (f FileStorageFoldersUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageFoldersUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageFoldersUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *FileStorageFoldersUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageFoldersUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageFoldersUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageFoldersUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageFoldersUpdateRequest) GetUpdateFolderRequest() components.UpdateFolderRequest { - if o == nil { - return components.UpdateFolderRequest{} - } - return o.UpdateFolderRequest -} - -type FileStorageFoldersUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Folders - UpdateFolderResponse *components.UpdateFolderResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageFoldersUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageFoldersUpdateResponse) GetUpdateFolderResponse() *components.UpdateFolderResponse { - if o == nil { - return nil - } - return o.UpdateFolderResponse -} - -func (o *FileStorageFoldersUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragesharedlinksadd.go b/tests/mockserver/internal/sdk/models/operations/filestoragesharedlinksadd.go deleted file mode 100644 index 663856bb..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragesharedlinksadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageSharedLinksAddGlobals 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 *FileStorageSharedLinksAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageSharedLinksAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageSharedLinksAddRequest 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"` - SharedLink components.SharedLinkInput `request:"mediaType=application/json"` -} - -func (f FileStorageSharedLinksAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageSharedLinksAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageSharedLinksAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageSharedLinksAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageSharedLinksAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageSharedLinksAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageSharedLinksAddRequest) GetSharedLink() components.SharedLinkInput { - if o == nil { - return components.SharedLinkInput{} - } - return o.SharedLink -} - -type FileStorageSharedLinksAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Shared Links - CreateSharedLinkResponse *components.CreateSharedLinkResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageSharedLinksAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageSharedLinksAddResponse) GetCreateSharedLinkResponse() *components.CreateSharedLinkResponse { - if o == nil { - return nil - } - return o.CreateSharedLinkResponse -} - -func (o *FileStorageSharedLinksAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragesharedlinksall.go b/tests/mockserver/internal/sdk/models/operations/filestoragesharedlinksall.go deleted file mode 100644 index 6264f56c..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragesharedlinksall.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageSharedLinksAllGlobals 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 *FileStorageSharedLinksAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageSharedLinksAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageSharedLinksAllRequest 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"` - // 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 (f FileStorageSharedLinksAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageSharedLinksAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageSharedLinksAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageSharedLinksAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageSharedLinksAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageSharedLinksAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageSharedLinksAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *FileStorageSharedLinksAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *FileStorageSharedLinksAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *FileStorageSharedLinksAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type FileStorageSharedLinksAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Shared Links - GetSharedLinksResponse *components.GetSharedLinksResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*FileStorageSharedLinksAllResponse, error) -} - -func (o *FileStorageSharedLinksAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageSharedLinksAllResponse) GetGetSharedLinksResponse() *components.GetSharedLinksResponse { - if o == nil { - return nil - } - return o.GetSharedLinksResponse -} - -func (o *FileStorageSharedLinksAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragesharedlinksdelete.go b/tests/mockserver/internal/sdk/models/operations/filestoragesharedlinksdelete.go deleted file mode 100644 index 24441aab..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragesharedlinksdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageSharedLinksDeleteGlobals 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 *FileStorageSharedLinksDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageSharedLinksDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageSharedLinksDeleteRequest 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 (f FileStorageSharedLinksDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageSharedLinksDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageSharedLinksDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *FileStorageSharedLinksDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageSharedLinksDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageSharedLinksDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageSharedLinksDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type FileStorageSharedLinksDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Shared Links - DeleteSharedLinkResponse *components.DeleteSharedLinkResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageSharedLinksDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageSharedLinksDeleteResponse) GetDeleteSharedLinkResponse() *components.DeleteSharedLinkResponse { - if o == nil { - return nil - } - return o.DeleteSharedLinkResponse -} - -func (o *FileStorageSharedLinksDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragesharedlinksone.go b/tests/mockserver/internal/sdk/models/operations/filestoragesharedlinksone.go deleted file mode 100644 index a37bc7f7..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragesharedlinksone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageSharedLinksOneGlobals 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 *FileStorageSharedLinksOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageSharedLinksOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageSharedLinksOneRequest 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 (f FileStorageSharedLinksOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageSharedLinksOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageSharedLinksOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *FileStorageSharedLinksOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageSharedLinksOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageSharedLinksOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageSharedLinksOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageSharedLinksOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type FileStorageSharedLinksOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Shared Link - GetSharedLinkResponse *components.GetSharedLinkResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageSharedLinksOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageSharedLinksOneResponse) GetGetSharedLinkResponse() *components.GetSharedLinkResponse { - if o == nil { - return nil - } - return o.GetSharedLinkResponse -} - -func (o *FileStorageSharedLinksOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestoragesharedlinksupdate.go b/tests/mockserver/internal/sdk/models/operations/filestoragesharedlinksupdate.go deleted file mode 100644 index abae852f..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestoragesharedlinksupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageSharedLinksUpdateGlobals 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 *FileStorageSharedLinksUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageSharedLinksUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageSharedLinksUpdateRequest 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"` - SharedLink components.SharedLinkInput `request:"mediaType=application/json"` -} - -func (f FileStorageSharedLinksUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageSharedLinksUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageSharedLinksUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *FileStorageSharedLinksUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageSharedLinksUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageSharedLinksUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageSharedLinksUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageSharedLinksUpdateRequest) GetSharedLink() components.SharedLinkInput { - if o == nil { - return components.SharedLinkInput{} - } - return o.SharedLink -} - -type FileStorageSharedLinksUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Shared Links - UpdateSharedLinkResponse *components.UpdateSharedLinkResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageSharedLinksUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageSharedLinksUpdateResponse) GetUpdateSharedLinkResponse() *components.UpdateSharedLinkResponse { - if o == nil { - return nil - } - return o.UpdateSharedLinkResponse -} - -func (o *FileStorageSharedLinksUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestorageuploadsessionsadd.go b/tests/mockserver/internal/sdk/models/operations/filestorageuploadsessionsadd.go deleted file mode 100644 index 51d4f431..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestorageuploadsessionsadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageUploadSessionsAddGlobals 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 *FileStorageUploadSessionsAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageUploadSessionsAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageUploadSessionsAddRequest 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"` - CreateUploadSessionRequest components.CreateUploadSessionRequest `request:"mediaType=application/json"` -} - -func (f FileStorageUploadSessionsAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageUploadSessionsAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageUploadSessionsAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageUploadSessionsAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageUploadSessionsAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageUploadSessionsAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageUploadSessionsAddRequest) GetCreateUploadSessionRequest() components.CreateUploadSessionRequest { - if o == nil { - return components.CreateUploadSessionRequest{} - } - return o.CreateUploadSessionRequest -} - -type FileStorageUploadSessionsAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // UploadSessions - CreateUploadSessionResponse *components.CreateUploadSessionResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageUploadSessionsAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageUploadSessionsAddResponse) GetCreateUploadSessionResponse() *components.CreateUploadSessionResponse { - if o == nil { - return nil - } - return o.CreateUploadSessionResponse -} - -func (o *FileStorageUploadSessionsAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestorageuploadsessionsdelete.go b/tests/mockserver/internal/sdk/models/operations/filestorageuploadsessionsdelete.go deleted file mode 100644 index c4d9865f..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestorageuploadsessionsdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageUploadSessionsDeleteGlobals 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 *FileStorageUploadSessionsDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageUploadSessionsDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageUploadSessionsDeleteRequest 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 (f FileStorageUploadSessionsDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageUploadSessionsDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageUploadSessionsDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *FileStorageUploadSessionsDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageUploadSessionsDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageUploadSessionsDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageUploadSessionsDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type FileStorageUploadSessionsDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // UploadSessions - DeleteUploadSessionResponse *components.DeleteUploadSessionResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageUploadSessionsDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageUploadSessionsDeleteResponse) GetDeleteUploadSessionResponse() *components.DeleteUploadSessionResponse { - if o == nil { - return nil - } - return o.DeleteUploadSessionResponse -} - -func (o *FileStorageUploadSessionsDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestorageuploadsessionsfinish.go b/tests/mockserver/internal/sdk/models/operations/filestorageuploadsessionsfinish.go deleted file mode 100644 index 937b322e..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestorageuploadsessionsfinish.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageUploadSessionsFinishGlobals 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 *FileStorageUploadSessionsFinishGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageUploadSessionsFinishGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageUploadSessionsFinishRequestBody struct { -} - -type FileStorageUploadSessionsFinishRequest struct { - // ID of the record you are acting upon. - ID string `pathParam:"style=simple,explode=false,name=id"` - // 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"` - // The RFC3230 message digest of the uploaded part. Only required for the Box connector. More information on the Box API docs [here](https://developer.box.com/reference/put-files-upload-sessions-id/#param-digest) - Digest *string `header:"style=simple,explode=false,name=digest"` - RequestBody *FileStorageUploadSessionsFinishRequestBody `request:"mediaType=application/json"` -} - -func (f FileStorageUploadSessionsFinishRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageUploadSessionsFinishRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageUploadSessionsFinishRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *FileStorageUploadSessionsFinishRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageUploadSessionsFinishRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageUploadSessionsFinishRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageUploadSessionsFinishRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageUploadSessionsFinishRequest) GetDigest() *string { - if o == nil { - return nil - } - return o.Digest -} - -func (o *FileStorageUploadSessionsFinishRequest) GetRequestBody() *FileStorageUploadSessionsFinishRequestBody { - if o == nil { - return nil - } - return o.RequestBody -} - -type FileStorageUploadSessionsFinishResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // File - GetFileResponse *components.GetFileResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageUploadSessionsFinishResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageUploadSessionsFinishResponse) GetGetFileResponse() *components.GetFileResponse { - if o == nil { - return nil - } - return o.GetFileResponse -} - -func (o *FileStorageUploadSessionsFinishResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestorageuploadsessionsone.go b/tests/mockserver/internal/sdk/models/operations/filestorageuploadsessionsone.go deleted file mode 100644 index b55218c9..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestorageuploadsessionsone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageUploadSessionsOneGlobals 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 *FileStorageUploadSessionsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageUploadSessionsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageUploadSessionsOneRequest 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 (f FileStorageUploadSessionsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageUploadSessionsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageUploadSessionsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *FileStorageUploadSessionsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageUploadSessionsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageUploadSessionsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageUploadSessionsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageUploadSessionsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type FileStorageUploadSessionsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // UploadSessions - GetUploadSessionResponse *components.GetUploadSessionResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageUploadSessionsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageUploadSessionsOneResponse) GetGetUploadSessionResponse() *components.GetUploadSessionResponse { - if o == nil { - return nil - } - return o.GetUploadSessionResponse -} - -func (o *FileStorageUploadSessionsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/filestorageuploadsessionsupload.go b/tests/mockserver/internal/sdk/models/operations/filestorageuploadsessionsupload.go deleted file mode 100644 index 07186248..00000000 --- a/tests/mockserver/internal/sdk/models/operations/filestorageuploadsessionsupload.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "io" - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type FileStorageUploadSessionsUploadGlobals 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 *FileStorageUploadSessionsUploadGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageUploadSessionsUploadGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type FileStorageUploadSessionsUploadRequest 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"` - // Part number of the file part being uploaded. - PartNumber float64 `queryParam:"style=form,explode=true,name=part_number"` - // The RFC3230 message digest of the uploaded part. Only required for the Box connector. More information on the Box API docs [here](https://developer.box.com/reference/put-files-upload-sessions-id/#param-digest) - Digest *string `header:"style=simple,explode=false,name=digest"` - // Include raw response. Mostly used for debugging purposes - Raw *bool `default:"false" queryParam:"style=form,explode=true,name=raw"` - RequestBody io.Reader `request:"mediaType=*/*"` -} - -func (f FileStorageUploadSessionsUploadRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(f, "", false) -} - -func (f *FileStorageUploadSessionsUploadRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &f, "", false, false); err != nil { - return err - } - return nil -} - -func (o *FileStorageUploadSessionsUploadRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *FileStorageUploadSessionsUploadRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *FileStorageUploadSessionsUploadRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *FileStorageUploadSessionsUploadRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *FileStorageUploadSessionsUploadRequest) GetPartNumber() float64 { - if o == nil { - return 0.0 - } - return o.PartNumber -} - -func (o *FileStorageUploadSessionsUploadRequest) GetDigest() *string { - if o == nil { - return nil - } - return o.Digest -} - -func (o *FileStorageUploadSessionsUploadRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *FileStorageUploadSessionsUploadRequest) GetRequestBody() io.Reader { - if o == nil { - return nil - } - return o.RequestBody -} - -type FileStorageUploadSessionsUploadResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // UploadSessions - UpdateUploadSessionResponse *components.UpdateUploadSessionResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *FileStorageUploadSessionsUploadResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *FileStorageUploadSessionsUploadResponse) GetUpdateUploadSessionResponse() *components.UpdateUploadSessionResponse { - if o == nil { - return nil - } - return o.UpdateUploadSessionResponse -} - -func (o *FileStorageUploadSessionsUploadResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hriscompaniesadd.go b/tests/mockserver/internal/sdk/models/operations/hriscompaniesadd.go deleted file mode 100644 index 04f3c0d7..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hriscompaniesadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisCompaniesAddGlobals 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 *HrisCompaniesAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisCompaniesAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisCompaniesAddRequest 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"` - HrisCompany components.HrisCompanyInput `request:"mediaType=application/json"` -} - -func (h HrisCompaniesAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisCompaniesAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisCompaniesAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *HrisCompaniesAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisCompaniesAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisCompaniesAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisCompaniesAddRequest) GetHrisCompany() components.HrisCompanyInput { - if o == nil { - return components.HrisCompanyInput{} - } - return o.HrisCompany -} - -type HrisCompaniesAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Companies - CreateHrisCompanyResponse *components.CreateHrisCompanyResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *HrisCompaniesAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisCompaniesAddResponse) GetCreateHrisCompanyResponse() *components.CreateHrisCompanyResponse { - if o == nil { - return nil - } - return o.CreateHrisCompanyResponse -} - -func (o *HrisCompaniesAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hriscompaniesall.go b/tests/mockserver/internal/sdk/models/operations/hriscompaniesall.go deleted file mode 100644 index 32142e36..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hriscompaniesall.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisCompaniesAllGlobals 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 *HrisCompaniesAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisCompaniesAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisCompaniesAllRequest 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"` - // 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 (h HrisCompaniesAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisCompaniesAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisCompaniesAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *HrisCompaniesAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisCompaniesAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisCompaniesAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisCompaniesAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *HrisCompaniesAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *HrisCompaniesAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *HrisCompaniesAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type HrisCompaniesAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Companies - GetHrisCompaniesResponse *components.GetHrisCompaniesResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*HrisCompaniesAllResponse, error) -} - -func (o *HrisCompaniesAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisCompaniesAllResponse) GetGetHrisCompaniesResponse() *components.GetHrisCompaniesResponse { - if o == nil { - return nil - } - return o.GetHrisCompaniesResponse -} - -func (o *HrisCompaniesAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hriscompaniesdelete.go b/tests/mockserver/internal/sdk/models/operations/hriscompaniesdelete.go deleted file mode 100644 index 6da8d50b..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hriscompaniesdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisCompaniesDeleteGlobals 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 *HrisCompaniesDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisCompaniesDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisCompaniesDeleteRequest 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 (h HrisCompaniesDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisCompaniesDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisCompaniesDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *HrisCompaniesDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisCompaniesDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisCompaniesDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisCompaniesDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type HrisCompaniesDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Companies - DeleteHrisCompanyResponse *components.DeleteHrisCompanyResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *HrisCompaniesDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisCompaniesDeleteResponse) GetDeleteHrisCompanyResponse() *components.DeleteHrisCompanyResponse { - if o == nil { - return nil - } - return o.DeleteHrisCompanyResponse -} - -func (o *HrisCompaniesDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hriscompaniesone.go b/tests/mockserver/internal/sdk/models/operations/hriscompaniesone.go deleted file mode 100644 index c1c9fd4b..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hriscompaniesone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisCompaniesOneGlobals 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 *HrisCompaniesOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisCompaniesOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisCompaniesOneRequest 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 (h HrisCompaniesOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisCompaniesOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisCompaniesOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *HrisCompaniesOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisCompaniesOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisCompaniesOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisCompaniesOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *HrisCompaniesOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type HrisCompaniesOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Company - GetHrisCompanyResponse *components.GetHrisCompanyResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *HrisCompaniesOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisCompaniesOneResponse) GetGetHrisCompanyResponse() *components.GetHrisCompanyResponse { - if o == nil { - return nil - } - return o.GetHrisCompanyResponse -} - -func (o *HrisCompaniesOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hriscompaniesupdate.go b/tests/mockserver/internal/sdk/models/operations/hriscompaniesupdate.go deleted file mode 100644 index 22ced919..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hriscompaniesupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisCompaniesUpdateGlobals 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 *HrisCompaniesUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisCompaniesUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisCompaniesUpdateRequest 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"` - HrisCompany components.HrisCompanyInput `request:"mediaType=application/json"` -} - -func (h HrisCompaniesUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisCompaniesUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisCompaniesUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *HrisCompaniesUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisCompaniesUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisCompaniesUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisCompaniesUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *HrisCompaniesUpdateRequest) GetHrisCompany() components.HrisCompanyInput { - if o == nil { - return components.HrisCompanyInput{} - } - return o.HrisCompany -} - -type HrisCompaniesUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Companies - UpdateHrisCompanyResponse *components.UpdateHrisCompanyResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *HrisCompaniesUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisCompaniesUpdateResponse) GetUpdateHrisCompanyResponse() *components.UpdateHrisCompanyResponse { - if o == nil { - return nil - } - return o.UpdateHrisCompanyResponse -} - -func (o *HrisCompaniesUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hrisdepartmentsadd.go b/tests/mockserver/internal/sdk/models/operations/hrisdepartmentsadd.go deleted file mode 100644 index 4cd308fb..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hrisdepartmentsadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisDepartmentsAddGlobals 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 *HrisDepartmentsAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisDepartmentsAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisDepartmentsAddRequest 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"` - Department components.DepartmentInput `request:"mediaType=application/json"` -} - -func (h HrisDepartmentsAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisDepartmentsAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisDepartmentsAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *HrisDepartmentsAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisDepartmentsAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisDepartmentsAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisDepartmentsAddRequest) GetDepartment() components.DepartmentInput { - if o == nil { - return components.DepartmentInput{} - } - return o.Department -} - -type HrisDepartmentsAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Departments - CreateDepartmentResponse *components.CreateDepartmentResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *HrisDepartmentsAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisDepartmentsAddResponse) GetCreateDepartmentResponse() *components.CreateDepartmentResponse { - if o == nil { - return nil - } - return o.CreateDepartmentResponse -} - -func (o *HrisDepartmentsAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hrisdepartmentsall.go b/tests/mockserver/internal/sdk/models/operations/hrisdepartmentsall.go deleted file mode 100644 index ea19c2eb..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hrisdepartmentsall.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisDepartmentsAllGlobals 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 *HrisDepartmentsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisDepartmentsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisDepartmentsAllRequest 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"` - // 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 (h HrisDepartmentsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisDepartmentsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisDepartmentsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *HrisDepartmentsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisDepartmentsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisDepartmentsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisDepartmentsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *HrisDepartmentsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *HrisDepartmentsAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *HrisDepartmentsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type HrisDepartmentsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Departments - GetDepartmentsResponse *components.GetDepartmentsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*HrisDepartmentsAllResponse, error) -} - -func (o *HrisDepartmentsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisDepartmentsAllResponse) GetGetDepartmentsResponse() *components.GetDepartmentsResponse { - if o == nil { - return nil - } - return o.GetDepartmentsResponse -} - -func (o *HrisDepartmentsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hrisdepartmentsdelete.go b/tests/mockserver/internal/sdk/models/operations/hrisdepartmentsdelete.go deleted file mode 100644 index 64153627..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hrisdepartmentsdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisDepartmentsDeleteGlobals 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 *HrisDepartmentsDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisDepartmentsDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisDepartmentsDeleteRequest 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 (h HrisDepartmentsDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisDepartmentsDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisDepartmentsDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *HrisDepartmentsDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisDepartmentsDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisDepartmentsDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisDepartmentsDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type HrisDepartmentsDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Departments - DeleteDepartmentResponse *components.DeleteDepartmentResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *HrisDepartmentsDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisDepartmentsDeleteResponse) GetDeleteDepartmentResponse() *components.DeleteDepartmentResponse { - if o == nil { - return nil - } - return o.DeleteDepartmentResponse -} - -func (o *HrisDepartmentsDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hrisdepartmentsone.go b/tests/mockserver/internal/sdk/models/operations/hrisdepartmentsone.go deleted file mode 100644 index b4c27fb7..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hrisdepartmentsone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisDepartmentsOneGlobals 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 *HrisDepartmentsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisDepartmentsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisDepartmentsOneRequest 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 (h HrisDepartmentsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisDepartmentsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisDepartmentsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *HrisDepartmentsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisDepartmentsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisDepartmentsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisDepartmentsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *HrisDepartmentsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type HrisDepartmentsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Departments - GetDepartmentResponse *components.GetDepartmentResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *HrisDepartmentsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisDepartmentsOneResponse) GetGetDepartmentResponse() *components.GetDepartmentResponse { - if o == nil { - return nil - } - return o.GetDepartmentResponse -} - -func (o *HrisDepartmentsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hrisdepartmentsupdate.go b/tests/mockserver/internal/sdk/models/operations/hrisdepartmentsupdate.go deleted file mode 100644 index f43f4ef1..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hrisdepartmentsupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisDepartmentsUpdateGlobals 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 *HrisDepartmentsUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisDepartmentsUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisDepartmentsUpdateRequest 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"` - Department components.DepartmentInput `request:"mediaType=application/json"` -} - -func (h HrisDepartmentsUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisDepartmentsUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisDepartmentsUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *HrisDepartmentsUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisDepartmentsUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisDepartmentsUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisDepartmentsUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *HrisDepartmentsUpdateRequest) GetDepartment() components.DepartmentInput { - if o == nil { - return components.DepartmentInput{} - } - return o.Department -} - -type HrisDepartmentsUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Departments - UpdateDepartmentResponse *components.UpdateDepartmentResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *HrisDepartmentsUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisDepartmentsUpdateResponse) GetUpdateDepartmentResponse() *components.UpdateDepartmentResponse { - if o == nil { - return nil - } - return o.UpdateDepartmentResponse -} - -func (o *HrisDepartmentsUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hrisemployeepayrollsall.go b/tests/mockserver/internal/sdk/models/operations/hrisemployeepayrollsall.go deleted file mode 100644 index 776ead34..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hrisemployeepayrollsall.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisEmployeePayrollsAllGlobals 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 *HrisEmployeePayrollsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisEmployeePayrollsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisEmployeePayrollsAllRequest struct { - // ID of the employee you are acting upon. - EmployeeID string `pathParam:"style=simple,explode=false,name=employee_id"` - // 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"` - // Apply filters - Filter *components.PayrollsFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // 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 (h HrisEmployeePayrollsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisEmployeePayrollsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisEmployeePayrollsAllRequest) GetEmployeeID() string { - if o == nil { - return "" - } - return o.EmployeeID -} - -func (o *HrisEmployeePayrollsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *HrisEmployeePayrollsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisEmployeePayrollsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisEmployeePayrollsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisEmployeePayrollsAllRequest) GetFilter() *components.PayrollsFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *HrisEmployeePayrollsAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *HrisEmployeePayrollsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type HrisEmployeePayrollsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // EmployeePayrolls - GetEmployeePayrollsResponse *components.GetEmployeePayrollsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *HrisEmployeePayrollsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisEmployeePayrollsAllResponse) GetGetEmployeePayrollsResponse() *components.GetEmployeePayrollsResponse { - if o == nil { - return nil - } - return o.GetEmployeePayrollsResponse -} - -func (o *HrisEmployeePayrollsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hrisemployeepayrollsone.go b/tests/mockserver/internal/sdk/models/operations/hrisemployeepayrollsone.go deleted file mode 100644 index 8c629c44..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hrisemployeepayrollsone.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisEmployeePayrollsOneGlobals 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 *HrisEmployeePayrollsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisEmployeePayrollsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisEmployeePayrollsOneRequest struct { - // ID of the payroll you are acting upon. - PayrollID string `pathParam:"style=simple,explode=false,name=payroll_id"` - // ID of the employee you are acting upon. - EmployeeID string `pathParam:"style=simple,explode=false,name=employee_id"` - // 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"` - // 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 (h HrisEmployeePayrollsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisEmployeePayrollsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisEmployeePayrollsOneRequest) GetPayrollID() string { - if o == nil { - return "" - } - return o.PayrollID -} - -func (o *HrisEmployeePayrollsOneRequest) GetEmployeeID() string { - if o == nil { - return "" - } - return o.EmployeeID -} - -func (o *HrisEmployeePayrollsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *HrisEmployeePayrollsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisEmployeePayrollsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisEmployeePayrollsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisEmployeePayrollsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type HrisEmployeePayrollsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Payrolls - GetEmployeePayrollResponse *components.GetEmployeePayrollResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *HrisEmployeePayrollsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisEmployeePayrollsOneResponse) GetGetEmployeePayrollResponse() *components.GetEmployeePayrollResponse { - if o == nil { - return nil - } - return o.GetEmployeePayrollResponse -} - -func (o *HrisEmployeePayrollsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hrisemployeesadd.go b/tests/mockserver/internal/sdk/models/operations/hrisemployeesadd.go deleted file mode 100644 index 68cd21bb..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hrisemployeesadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisEmployeesAddGlobals 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 *HrisEmployeesAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisEmployeesAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisEmployeesAddRequest 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"` - Employee components.EmployeeInput `request:"mediaType=application/json"` -} - -func (h HrisEmployeesAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisEmployeesAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisEmployeesAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *HrisEmployeesAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisEmployeesAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisEmployeesAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisEmployeesAddRequest) GetEmployee() components.EmployeeInput { - if o == nil { - return components.EmployeeInput{} - } - return o.Employee -} - -type HrisEmployeesAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Employees - CreateEmployeeResponse *components.CreateEmployeeResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *HrisEmployeesAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisEmployeesAddResponse) GetCreateEmployeeResponse() *components.CreateEmployeeResponse { - if o == nil { - return nil - } - return o.CreateEmployeeResponse -} - -func (o *HrisEmployeesAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hrisemployeesall.go b/tests/mockserver/internal/sdk/models/operations/hrisemployeesall.go deleted file mode 100644 index 420d8e8b..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hrisemployeesall.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisEmployeesAllGlobals 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 *HrisEmployeesAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisEmployeesAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisEmployeesAllRequest 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.EmployeesFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // Apply sorting - Sort *components.EmployeesSort `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 (h HrisEmployeesAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisEmployeesAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisEmployeesAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *HrisEmployeesAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisEmployeesAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisEmployeesAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisEmployeesAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *HrisEmployeesAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *HrisEmployeesAllRequest) GetFilter() *components.EmployeesFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *HrisEmployeesAllRequest) GetSort() *components.EmployeesSort { - if o == nil { - return nil - } - return o.Sort -} - -func (o *HrisEmployeesAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *HrisEmployeesAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type HrisEmployeesAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Employees - GetEmployeesResponse *components.GetEmployeesResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*HrisEmployeesAllResponse, error) -} - -func (o *HrisEmployeesAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisEmployeesAllResponse) GetGetEmployeesResponse() *components.GetEmployeesResponse { - if o == nil { - return nil - } - return o.GetEmployeesResponse -} - -func (o *HrisEmployeesAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hrisemployeeschedulesall.go b/tests/mockserver/internal/sdk/models/operations/hrisemployeeschedulesall.go deleted file mode 100644 index 7ceb0bf7..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hrisemployeeschedulesall.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisEmployeeSchedulesAllGlobals 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 *HrisEmployeeSchedulesAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisEmployeeSchedulesAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisEmployeeSchedulesAllRequest struct { - // ID of the employee you are acting upon. - EmployeeID string `pathParam:"style=simple,explode=false,name=employee_id"` - // 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"` - // 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 (h HrisEmployeeSchedulesAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisEmployeeSchedulesAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisEmployeeSchedulesAllRequest) GetEmployeeID() string { - if o == nil { - return "" - } - return o.EmployeeID -} - -func (o *HrisEmployeeSchedulesAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *HrisEmployeeSchedulesAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisEmployeeSchedulesAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisEmployeeSchedulesAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisEmployeeSchedulesAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *HrisEmployeeSchedulesAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type HrisEmployeeSchedulesAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // EmployeeSchedules - GetEmployeeSchedulesResponse *components.GetEmployeeSchedulesResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *HrisEmployeeSchedulesAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisEmployeeSchedulesAllResponse) GetGetEmployeeSchedulesResponse() *components.GetEmployeeSchedulesResponse { - if o == nil { - return nil - } - return o.GetEmployeeSchedulesResponse -} - -func (o *HrisEmployeeSchedulesAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hrisemployeesdelete.go b/tests/mockserver/internal/sdk/models/operations/hrisemployeesdelete.go deleted file mode 100644 index 328b2593..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hrisemployeesdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisEmployeesDeleteGlobals 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 *HrisEmployeesDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisEmployeesDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisEmployeesDeleteRequest 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 (h HrisEmployeesDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisEmployeesDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisEmployeesDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *HrisEmployeesDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisEmployeesDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisEmployeesDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisEmployeesDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type HrisEmployeesDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Employees - DeleteEmployeeResponse *components.DeleteEmployeeResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *HrisEmployeesDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisEmployeesDeleteResponse) GetDeleteEmployeeResponse() *components.DeleteEmployeeResponse { - if o == nil { - return nil - } - return o.DeleteEmployeeResponse -} - -func (o *HrisEmployeesDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hrisemployeesone.go b/tests/mockserver/internal/sdk/models/operations/hrisemployeesone.go deleted file mode 100644 index 4293cb65..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hrisemployeesone.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisEmployeesOneGlobals 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 *HrisEmployeesOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisEmployeesOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisEmployeesOneRequest 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"` - // Apply filters - Filter *components.EmployeesOneFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // 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"` -} - -func (h HrisEmployeesOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisEmployeesOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisEmployeesOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *HrisEmployeesOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisEmployeesOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisEmployeesOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisEmployeesOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *HrisEmployeesOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -func (o *HrisEmployeesOneRequest) GetFilter() *components.EmployeesOneFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *HrisEmployeesOneRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -type HrisEmployeesOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Employees - GetEmployeeResponse *components.GetEmployeeResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *HrisEmployeesOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisEmployeesOneResponse) GetGetEmployeeResponse() *components.GetEmployeeResponse { - if o == nil { - return nil - } - return o.GetEmployeeResponse -} - -func (o *HrisEmployeesOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hrisemployeesupdate.go b/tests/mockserver/internal/sdk/models/operations/hrisemployeesupdate.go deleted file mode 100644 index c97a36e0..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hrisemployeesupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisEmployeesUpdateGlobals 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 *HrisEmployeesUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisEmployeesUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisEmployeesUpdateRequest 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"` - Employee components.EmployeeInput `request:"mediaType=application/json"` -} - -func (h HrisEmployeesUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisEmployeesUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisEmployeesUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *HrisEmployeesUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisEmployeesUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisEmployeesUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisEmployeesUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *HrisEmployeesUpdateRequest) GetEmployee() components.EmployeeInput { - if o == nil { - return components.EmployeeInput{} - } - return o.Employee -} - -type HrisEmployeesUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Employees - UpdateEmployeeResponse *components.UpdateEmployeeResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *HrisEmployeesUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisEmployeesUpdateResponse) GetUpdateEmployeeResponse() *components.UpdateEmployeeResponse { - if o == nil { - return nil - } - return o.UpdateEmployeeResponse -} - -func (o *HrisEmployeesUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hrispayrollsall.go b/tests/mockserver/internal/sdk/models/operations/hrispayrollsall.go deleted file mode 100644 index 726db763..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hrispayrollsall.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisPayrollsAllGlobals 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 *HrisPayrollsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisPayrollsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisPayrollsAllRequest 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"` - // Apply filters - Filter *components.PayrollsFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // 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 (h HrisPayrollsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisPayrollsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisPayrollsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *HrisPayrollsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisPayrollsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisPayrollsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisPayrollsAllRequest) GetFilter() *components.PayrollsFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *HrisPayrollsAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *HrisPayrollsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type HrisPayrollsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Payrolls - GetPayrollsResponse *components.GetPayrollsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *HrisPayrollsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisPayrollsAllResponse) GetGetPayrollsResponse() *components.GetPayrollsResponse { - if o == nil { - return nil - } - return o.GetPayrollsResponse -} - -func (o *HrisPayrollsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hrispayrollsone.go b/tests/mockserver/internal/sdk/models/operations/hrispayrollsone.go deleted file mode 100644 index cee347a4..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hrispayrollsone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisPayrollsOneGlobals 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 *HrisPayrollsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisPayrollsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisPayrollsOneRequest struct { - // ID of the payroll you are acting upon. - PayrollID string `pathParam:"style=simple,explode=false,name=payroll_id"` - // 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"` - // 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 (h HrisPayrollsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisPayrollsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisPayrollsOneRequest) GetPayrollID() string { - if o == nil { - return "" - } - return o.PayrollID -} - -func (o *HrisPayrollsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *HrisPayrollsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisPayrollsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisPayrollsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisPayrollsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type HrisPayrollsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Payrolls - GetPayrollResponse *components.GetPayrollResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *HrisPayrollsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisPayrollsOneResponse) GetGetPayrollResponse() *components.GetPayrollResponse { - if o == nil { - return nil - } - return o.GetPayrollResponse -} - -func (o *HrisPayrollsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hristimeoffrequestsadd.go b/tests/mockserver/internal/sdk/models/operations/hristimeoffrequestsadd.go deleted file mode 100644 index 833c915d..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hristimeoffrequestsadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisTimeOffRequestsAddGlobals 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 *HrisTimeOffRequestsAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisTimeOffRequestsAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisTimeOffRequestsAddRequest 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"` - TimeOffRequest components.TimeOffRequestInput `request:"mediaType=application/json"` -} - -func (h HrisTimeOffRequestsAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisTimeOffRequestsAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisTimeOffRequestsAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *HrisTimeOffRequestsAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisTimeOffRequestsAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisTimeOffRequestsAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisTimeOffRequestsAddRequest) GetTimeOffRequest() components.TimeOffRequestInput { - if o == nil { - return components.TimeOffRequestInput{} - } - return o.TimeOffRequest -} - -type HrisTimeOffRequestsAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // TimeOffRequests - CreateTimeOffRequestResponse *components.CreateTimeOffRequestResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *HrisTimeOffRequestsAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisTimeOffRequestsAddResponse) GetCreateTimeOffRequestResponse() *components.CreateTimeOffRequestResponse { - if o == nil { - return nil - } - return o.CreateTimeOffRequestResponse -} - -func (o *HrisTimeOffRequestsAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hristimeoffrequestsall.go b/tests/mockserver/internal/sdk/models/operations/hristimeoffrequestsall.go deleted file mode 100644 index c1ff8ef5..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hristimeoffrequestsall.go +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisTimeOffRequestsAllGlobals 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 *HrisTimeOffRequestsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisTimeOffRequestsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisTimeOffRequestsAllRequest 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.TimeOffRequestsFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // 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 (h HrisTimeOffRequestsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisTimeOffRequestsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisTimeOffRequestsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *HrisTimeOffRequestsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisTimeOffRequestsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisTimeOffRequestsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisTimeOffRequestsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *HrisTimeOffRequestsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *HrisTimeOffRequestsAllRequest) GetFilter() *components.TimeOffRequestsFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *HrisTimeOffRequestsAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *HrisTimeOffRequestsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type HrisTimeOffRequestsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // TimeOffRequests - GetTimeOffRequestsResponse *components.GetTimeOffRequestsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*HrisTimeOffRequestsAllResponse, error) -} - -func (o *HrisTimeOffRequestsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisTimeOffRequestsAllResponse) GetGetTimeOffRequestsResponse() *components.GetTimeOffRequestsResponse { - if o == nil { - return nil - } - return o.GetTimeOffRequestsResponse -} - -func (o *HrisTimeOffRequestsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hristimeoffrequestsdelete.go b/tests/mockserver/internal/sdk/models/operations/hristimeoffrequestsdelete.go deleted file mode 100644 index 3bf8dad5..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hristimeoffrequestsdelete.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisTimeOffRequestsDeleteGlobals 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 *HrisTimeOffRequestsDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisTimeOffRequestsDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisTimeOffRequestsDeleteRequest 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"` - // ID of the employee you are acting upon. - EmployeeID string `pathParam:"style=simple,explode=false,name=employee_id"` -} - -func (h HrisTimeOffRequestsDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisTimeOffRequestsDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisTimeOffRequestsDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *HrisTimeOffRequestsDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisTimeOffRequestsDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisTimeOffRequestsDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisTimeOffRequestsDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *HrisTimeOffRequestsDeleteRequest) GetEmployeeID() string { - if o == nil { - return "" - } - return o.EmployeeID -} - -type HrisTimeOffRequestsDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // TimeOffRequests - DeleteTimeOffRequestResponse *components.DeleteTimeOffRequestResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *HrisTimeOffRequestsDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisTimeOffRequestsDeleteResponse) GetDeleteTimeOffRequestResponse() *components.DeleteTimeOffRequestResponse { - if o == nil { - return nil - } - return o.DeleteTimeOffRequestResponse -} - -func (o *HrisTimeOffRequestsDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hristimeoffrequestsone.go b/tests/mockserver/internal/sdk/models/operations/hristimeoffrequestsone.go deleted file mode 100644 index d71195e4..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hristimeoffrequestsone.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisTimeOffRequestsOneGlobals 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 *HrisTimeOffRequestsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisTimeOffRequestsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisTimeOffRequestsOneRequest 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"` - // ID of the employee you are acting upon. - EmployeeID string `pathParam:"style=simple,explode=false,name=employee_id"` -} - -func (h HrisTimeOffRequestsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisTimeOffRequestsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisTimeOffRequestsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *HrisTimeOffRequestsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisTimeOffRequestsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisTimeOffRequestsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisTimeOffRequestsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *HrisTimeOffRequestsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -func (o *HrisTimeOffRequestsOneRequest) GetEmployeeID() string { - if o == nil { - return "" - } - return o.EmployeeID -} - -type HrisTimeOffRequestsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // TimeOffRequests - GetTimeOffRequestResponse *components.GetTimeOffRequestResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *HrisTimeOffRequestsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisTimeOffRequestsOneResponse) GetGetTimeOffRequestResponse() *components.GetTimeOffRequestResponse { - if o == nil { - return nil - } - return o.GetTimeOffRequestResponse -} - -func (o *HrisTimeOffRequestsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/hristimeoffrequestsupdate.go b/tests/mockserver/internal/sdk/models/operations/hristimeoffrequestsupdate.go deleted file mode 100644 index f19eb09b..00000000 --- a/tests/mockserver/internal/sdk/models/operations/hristimeoffrequestsupdate.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type HrisTimeOffRequestsUpdateGlobals 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 *HrisTimeOffRequestsUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisTimeOffRequestsUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type HrisTimeOffRequestsUpdateRequest 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"` - // ID of the employee you are acting upon. - EmployeeID string `pathParam:"style=simple,explode=false,name=employee_id"` - TimeOffRequest components.TimeOffRequestInput `request:"mediaType=application/json"` -} - -func (h HrisTimeOffRequestsUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *HrisTimeOffRequestsUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil -} - -func (o *HrisTimeOffRequestsUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *HrisTimeOffRequestsUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *HrisTimeOffRequestsUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *HrisTimeOffRequestsUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *HrisTimeOffRequestsUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *HrisTimeOffRequestsUpdateRequest) GetEmployeeID() string { - if o == nil { - return "" - } - return o.EmployeeID -} - -func (o *HrisTimeOffRequestsUpdateRequest) GetTimeOffRequest() components.TimeOffRequestInput { - if o == nil { - return components.TimeOffRequestInput{} - } - return o.TimeOffRequest -} - -type HrisTimeOffRequestsUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // TimeOffRequests - UpdateTimeOffRequestResponse *components.UpdateTimeOffRequestResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *HrisTimeOffRequestsUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *HrisTimeOffRequestsUpdateResponse) GetUpdateTimeOffRequestResponse() *components.UpdateTimeOffRequestResponse { - if o == nil { - return nil - } - return o.UpdateTimeOffRequestResponse -} - -func (o *HrisTimeOffRequestsUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionsall.go b/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionsall.go deleted file mode 100644 index 5fec7d83..00000000 --- a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionsall.go +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type IssueTrackingCollectionsAllGlobals 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 *IssueTrackingCollectionsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type IssueTrackingCollectionsAllRequest 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 sorting - Sort *components.CollectionsSort `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 (i IssueTrackingCollectionsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *IssueTrackingCollectionsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *IssueTrackingCollectionsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *IssueTrackingCollectionsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *IssueTrackingCollectionsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *IssueTrackingCollectionsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *IssueTrackingCollectionsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *IssueTrackingCollectionsAllRequest) GetSort() *components.CollectionsSort { - if o == nil { - return nil - } - return o.Sort -} - -func (o *IssueTrackingCollectionsAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *IssueTrackingCollectionsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type IssueTrackingCollectionsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // List Collections - GetCollectionsResponse *components.GetCollectionsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*IssueTrackingCollectionsAllResponse, error) -} - -func (o *IssueTrackingCollectionsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *IssueTrackingCollectionsAllResponse) GetGetCollectionsResponse() *components.GetCollectionsResponse { - if o == nil { - return nil - } - return o.GetCollectionsResponse -} - -func (o *IssueTrackingCollectionsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionsone.go b/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionsone.go deleted file mode 100644 index 08ef48af..00000000 --- a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionsone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type IssueTrackingCollectionsOneGlobals 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 *IssueTrackingCollectionsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type IssueTrackingCollectionsOneRequest struct { - // The collection ID - CollectionID string `pathParam:"style=simple,explode=false,name=collection_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 (i IssueTrackingCollectionsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *IssueTrackingCollectionsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *IssueTrackingCollectionsOneRequest) GetCollectionID() string { - if o == nil { - return "" - } - return o.CollectionID -} - -func (o *IssueTrackingCollectionsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *IssueTrackingCollectionsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *IssueTrackingCollectionsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *IssueTrackingCollectionsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type IssueTrackingCollectionsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Get a Collection - GetCollectionResponse *components.GetCollectionResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *IssueTrackingCollectionsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *IssueTrackingCollectionsOneResponse) GetGetCollectionResponse() *components.GetCollectionResponse { - if o == nil { - return nil - } - return o.GetCollectionResponse -} - -func (o *IssueTrackingCollectionsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectiontagsall.go b/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectiontagsall.go deleted file mode 100644 index a1e0247b..00000000 --- a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectiontagsall.go +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type IssueTrackingCollectionTagsAllGlobals 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 *IssueTrackingCollectionTagsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionTagsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type IssueTrackingCollectionTagsAllRequest struct { - // The collection ID - CollectionID string `pathParam:"style=simple,explode=false,name=collection_id"` - // 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"` - // 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 (i IssueTrackingCollectionTagsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *IssueTrackingCollectionTagsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *IssueTrackingCollectionTagsAllRequest) GetCollectionID() string { - if o == nil { - return "" - } - return o.CollectionID -} - -func (o *IssueTrackingCollectionTagsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *IssueTrackingCollectionTagsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionTagsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *IssueTrackingCollectionTagsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *IssueTrackingCollectionTagsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *IssueTrackingCollectionTagsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *IssueTrackingCollectionTagsAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *IssueTrackingCollectionTagsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type IssueTrackingCollectionTagsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // List Tags - GetCollectionTagsResponse *components.GetCollectionTagsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*IssueTrackingCollectionTagsAllResponse, error) -} - -func (o *IssueTrackingCollectionTagsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *IssueTrackingCollectionTagsAllResponse) GetGetCollectionTagsResponse() *components.GetCollectionTagsResponse { - if o == nil { - return nil - } - return o.GetCollectionTagsResponse -} - -func (o *IssueTrackingCollectionTagsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketcommentsadd.go b/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketcommentsadd.go deleted file mode 100644 index 18ac6b89..00000000 --- a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketcommentsadd.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type IssueTrackingCollectionTicketCommentsAddGlobals 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 *IssueTrackingCollectionTicketCommentsAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionTicketCommentsAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type IssueTrackingCollectionTicketCommentsAddRequest 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"` - // The collection ID - CollectionID string `pathParam:"style=simple,explode=false,name=collection_id"` - // ID of the ticket you are acting upon. - TicketID string `pathParam:"style=simple,explode=false,name=ticket_id"` - CollectionTicketComment components.CollectionTicketCommentInput `request:"mediaType=application/json"` -} - -func (i IssueTrackingCollectionTicketCommentsAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *IssueTrackingCollectionTicketCommentsAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *IssueTrackingCollectionTicketCommentsAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *IssueTrackingCollectionTicketCommentsAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionTicketCommentsAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *IssueTrackingCollectionTicketCommentsAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *IssueTrackingCollectionTicketCommentsAddRequest) GetCollectionID() string { - if o == nil { - return "" - } - return o.CollectionID -} - -func (o *IssueTrackingCollectionTicketCommentsAddRequest) GetTicketID() string { - if o == nil { - return "" - } - return o.TicketID -} - -func (o *IssueTrackingCollectionTicketCommentsAddRequest) GetCollectionTicketComment() components.CollectionTicketCommentInput { - if o == nil { - return components.CollectionTicketCommentInput{} - } - return o.CollectionTicketComment -} - -type IssueTrackingCollectionTicketCommentsAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Create a Comment - CreateCommentResponse *components.CreateCommentResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *IssueTrackingCollectionTicketCommentsAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *IssueTrackingCollectionTicketCommentsAddResponse) GetCreateCommentResponse() *components.CreateCommentResponse { - if o == nil { - return nil - } - return o.CreateCommentResponse -} - -func (o *IssueTrackingCollectionTicketCommentsAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketcommentsall.go b/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketcommentsall.go deleted file mode 100644 index aa6f0af2..00000000 --- a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketcommentsall.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type IssueTrackingCollectionTicketCommentsAllGlobals 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 *IssueTrackingCollectionTicketCommentsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionTicketCommentsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type IssueTrackingCollectionTicketCommentsAllRequest 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"` - // The collection ID - CollectionID string `pathParam:"style=simple,explode=false,name=collection_id"` - // ID of the ticket you are acting upon. - TicketID string `pathParam:"style=simple,explode=false,name=ticket_id"` - // Apply sorting - Sort *components.CommentsSort `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 (i IssueTrackingCollectionTicketCommentsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *IssueTrackingCollectionTicketCommentsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *IssueTrackingCollectionTicketCommentsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *IssueTrackingCollectionTicketCommentsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionTicketCommentsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *IssueTrackingCollectionTicketCommentsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *IssueTrackingCollectionTicketCommentsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *IssueTrackingCollectionTicketCommentsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *IssueTrackingCollectionTicketCommentsAllRequest) GetCollectionID() string { - if o == nil { - return "" - } - return o.CollectionID -} - -func (o *IssueTrackingCollectionTicketCommentsAllRequest) GetTicketID() string { - if o == nil { - return "" - } - return o.TicketID -} - -func (o *IssueTrackingCollectionTicketCommentsAllRequest) GetSort() *components.CommentsSort { - if o == nil { - return nil - } - return o.Sort -} - -func (o *IssueTrackingCollectionTicketCommentsAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *IssueTrackingCollectionTicketCommentsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type IssueTrackingCollectionTicketCommentsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // List Comments - GetCommentsResponse *components.GetCommentsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*IssueTrackingCollectionTicketCommentsAllResponse, error) -} - -func (o *IssueTrackingCollectionTicketCommentsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *IssueTrackingCollectionTicketCommentsAllResponse) GetGetCommentsResponse() *components.GetCommentsResponse { - if o == nil { - return nil - } - return o.GetCommentsResponse -} - -func (o *IssueTrackingCollectionTicketCommentsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketcommentsdelete.go b/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketcommentsdelete.go deleted file mode 100644 index 276c60de..00000000 --- a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketcommentsdelete.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type IssueTrackingCollectionTicketCommentsDeleteGlobals 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 *IssueTrackingCollectionTicketCommentsDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionTicketCommentsDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type IssueTrackingCollectionTicketCommentsDeleteRequest 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 collection ID - CollectionID string `pathParam:"style=simple,explode=false,name=collection_id"` - // ID of the ticket you are acting upon. - TicketID string `pathParam:"style=simple,explode=false,name=ticket_id"` -} - -func (i IssueTrackingCollectionTicketCommentsDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *IssueTrackingCollectionTicketCommentsDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *IssueTrackingCollectionTicketCommentsDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *IssueTrackingCollectionTicketCommentsDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionTicketCommentsDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *IssueTrackingCollectionTicketCommentsDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *IssueTrackingCollectionTicketCommentsDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *IssueTrackingCollectionTicketCommentsDeleteRequest) GetCollectionID() string { - if o == nil { - return "" - } - return o.CollectionID -} - -func (o *IssueTrackingCollectionTicketCommentsDeleteRequest) GetTicketID() string { - if o == nil { - return "" - } - return o.TicketID -} - -type IssueTrackingCollectionTicketCommentsDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Delete a Comment - DeleteCommentResponse *components.DeleteCommentResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *IssueTrackingCollectionTicketCommentsDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *IssueTrackingCollectionTicketCommentsDeleteResponse) GetDeleteCommentResponse() *components.DeleteCommentResponse { - if o == nil { - return nil - } - return o.DeleteCommentResponse -} - -func (o *IssueTrackingCollectionTicketCommentsDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketcommentsone.go b/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketcommentsone.go deleted file mode 100644 index 82240ff1..00000000 --- a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketcommentsone.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type IssueTrackingCollectionTicketCommentsOneGlobals 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 *IssueTrackingCollectionTicketCommentsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionTicketCommentsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type IssueTrackingCollectionTicketCommentsOneRequest struct { - // ID of the record you are acting upon. - ID string `pathParam:"style=simple,explode=false,name=id"` - // 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"` - // The collection ID - CollectionID string `pathParam:"style=simple,explode=false,name=collection_id"` - // ID of the ticket you are acting upon. - TicketID string `pathParam:"style=simple,explode=false,name=ticket_id"` - // 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 (i IssueTrackingCollectionTicketCommentsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *IssueTrackingCollectionTicketCommentsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *IssueTrackingCollectionTicketCommentsOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *IssueTrackingCollectionTicketCommentsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *IssueTrackingCollectionTicketCommentsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionTicketCommentsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *IssueTrackingCollectionTicketCommentsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *IssueTrackingCollectionTicketCommentsOneRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *IssueTrackingCollectionTicketCommentsOneRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *IssueTrackingCollectionTicketCommentsOneRequest) GetCollectionID() string { - if o == nil { - return "" - } - return o.CollectionID -} - -func (o *IssueTrackingCollectionTicketCommentsOneRequest) GetTicketID() string { - if o == nil { - return "" - } - return o.TicketID -} - -func (o *IssueTrackingCollectionTicketCommentsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type IssueTrackingCollectionTicketCommentsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Get a Comment - GetCommentResponse *components.GetCommentResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*IssueTrackingCollectionTicketCommentsOneResponse, error) -} - -func (o *IssueTrackingCollectionTicketCommentsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *IssueTrackingCollectionTicketCommentsOneResponse) GetGetCommentResponse() *components.GetCommentResponse { - if o == nil { - return nil - } - return o.GetCommentResponse -} - -func (o *IssueTrackingCollectionTicketCommentsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketcommentsupdate.go b/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketcommentsupdate.go deleted file mode 100644 index 5501656d..00000000 --- a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketcommentsupdate.go +++ /dev/null @@ -1,143 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type IssueTrackingCollectionTicketCommentsUpdateGlobals 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 *IssueTrackingCollectionTicketCommentsUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionTicketCommentsUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type IssueTrackingCollectionTicketCommentsUpdateRequest 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 collection ID - CollectionID string `pathParam:"style=simple,explode=false,name=collection_id"` - // ID of the ticket you are acting upon. - TicketID string `pathParam:"style=simple,explode=false,name=ticket_id"` - CollectionTicketComment components.CollectionTicketCommentInput `request:"mediaType=application/json"` -} - -func (i IssueTrackingCollectionTicketCommentsUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *IssueTrackingCollectionTicketCommentsUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *IssueTrackingCollectionTicketCommentsUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *IssueTrackingCollectionTicketCommentsUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionTicketCommentsUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *IssueTrackingCollectionTicketCommentsUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *IssueTrackingCollectionTicketCommentsUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *IssueTrackingCollectionTicketCommentsUpdateRequest) GetCollectionID() string { - if o == nil { - return "" - } - return o.CollectionID -} - -func (o *IssueTrackingCollectionTicketCommentsUpdateRequest) GetTicketID() string { - if o == nil { - return "" - } - return o.TicketID -} - -func (o *IssueTrackingCollectionTicketCommentsUpdateRequest) GetCollectionTicketComment() components.CollectionTicketCommentInput { - if o == nil { - return components.CollectionTicketCommentInput{} - } - return o.CollectionTicketComment -} - -type IssueTrackingCollectionTicketCommentsUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Update a Comment - UpdateCommentResponse *components.UpdateCommentResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *IssueTrackingCollectionTicketCommentsUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *IssueTrackingCollectionTicketCommentsUpdateResponse) GetUpdateCommentResponse() *components.UpdateCommentResponse { - if o == nil { - return nil - } - return o.UpdateCommentResponse -} - -func (o *IssueTrackingCollectionTicketCommentsUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketsadd.go b/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketsadd.go deleted file mode 100644 index 15474e67..00000000 --- a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketsadd.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type IssueTrackingCollectionTicketsAddGlobals 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 *IssueTrackingCollectionTicketsAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionTicketsAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type IssueTrackingCollectionTicketsAddRequest 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"` - // The collection ID - CollectionID string `pathParam:"style=simple,explode=false,name=collection_id"` - Ticket components.TicketInput `request:"mediaType=application/json"` -} - -func (i IssueTrackingCollectionTicketsAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *IssueTrackingCollectionTicketsAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *IssueTrackingCollectionTicketsAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *IssueTrackingCollectionTicketsAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionTicketsAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *IssueTrackingCollectionTicketsAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *IssueTrackingCollectionTicketsAddRequest) GetCollectionID() string { - if o == nil { - return "" - } - return o.CollectionID -} - -func (o *IssueTrackingCollectionTicketsAddRequest) GetTicket() components.TicketInput { - if o == nil { - return components.TicketInput{} - } - return o.Ticket -} - -type IssueTrackingCollectionTicketsAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Create a Ticket - CreateTicketResponse *components.CreateTicketResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *IssueTrackingCollectionTicketsAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *IssueTrackingCollectionTicketsAddResponse) GetCreateTicketResponse() *components.CreateTicketResponse { - if o == nil { - return nil - } - return o.CreateTicketResponse -} - -func (o *IssueTrackingCollectionTicketsAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketsall.go b/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketsall.go deleted file mode 100644 index 9ac92a59..00000000 --- a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketsall.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type IssueTrackingCollectionTicketsAllGlobals 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 *IssueTrackingCollectionTicketsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionTicketsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type IssueTrackingCollectionTicketsAllRequest 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"` - // The collection ID - CollectionID string `pathParam:"style=simple,explode=false,name=collection_id"` - // Apply sorting - Sort *components.TicketsSort `queryParam:"style=deepObject,explode=true,name=sort"` - // Apply filters - Filter *components.IssuesFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // 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 (i IssueTrackingCollectionTicketsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *IssueTrackingCollectionTicketsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *IssueTrackingCollectionTicketsAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *IssueTrackingCollectionTicketsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionTicketsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *IssueTrackingCollectionTicketsAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *IssueTrackingCollectionTicketsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *IssueTrackingCollectionTicketsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *IssueTrackingCollectionTicketsAllRequest) GetCollectionID() string { - if o == nil { - return "" - } - return o.CollectionID -} - -func (o *IssueTrackingCollectionTicketsAllRequest) GetSort() *components.TicketsSort { - if o == nil { - return nil - } - return o.Sort -} - -func (o *IssueTrackingCollectionTicketsAllRequest) GetFilter() *components.IssuesFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *IssueTrackingCollectionTicketsAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *IssueTrackingCollectionTicketsAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type IssueTrackingCollectionTicketsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // List Tickets - GetTicketsResponse *components.GetTicketsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*IssueTrackingCollectionTicketsAllResponse, error) -} - -func (o *IssueTrackingCollectionTicketsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *IssueTrackingCollectionTicketsAllResponse) GetGetTicketsResponse() *components.GetTicketsResponse { - if o == nil { - return nil - } - return o.GetTicketsResponse -} - -func (o *IssueTrackingCollectionTicketsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketsdelete.go b/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketsdelete.go deleted file mode 100644 index 8b4e9e49..00000000 --- a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketsdelete.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type IssueTrackingCollectionTicketsDeleteGlobals 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 *IssueTrackingCollectionTicketsDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionTicketsDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type IssueTrackingCollectionTicketsDeleteRequest struct { - // ID of the ticket you are acting upon. - TicketID string `pathParam:"style=simple,explode=false,name=ticket_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 collection ID - CollectionID string `pathParam:"style=simple,explode=false,name=collection_id"` -} - -func (i IssueTrackingCollectionTicketsDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *IssueTrackingCollectionTicketsDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *IssueTrackingCollectionTicketsDeleteRequest) GetTicketID() string { - if o == nil { - return "" - } - return o.TicketID -} - -func (o *IssueTrackingCollectionTicketsDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionTicketsDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *IssueTrackingCollectionTicketsDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *IssueTrackingCollectionTicketsDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *IssueTrackingCollectionTicketsDeleteRequest) GetCollectionID() string { - if o == nil { - return "" - } - return o.CollectionID -} - -type IssueTrackingCollectionTicketsDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Delete a Ticket - DeleteTicketResponse *components.DeleteTicketResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *IssueTrackingCollectionTicketsDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *IssueTrackingCollectionTicketsDeleteResponse) GetDeleteTicketResponse() *components.DeleteTicketResponse { - if o == nil { - return nil - } - return o.DeleteTicketResponse -} - -func (o *IssueTrackingCollectionTicketsDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketsone.go b/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketsone.go deleted file mode 100644 index d4d156d1..00000000 --- a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketsone.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type IssueTrackingCollectionTicketsOneGlobals 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 *IssueTrackingCollectionTicketsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionTicketsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type IssueTrackingCollectionTicketsOneRequest struct { - // ID of the ticket you are acting upon. - TicketID string `pathParam:"style=simple,explode=false,name=ticket_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 collection ID - CollectionID string `pathParam:"style=simple,explode=false,name=collection_id"` - // 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 (i IssueTrackingCollectionTicketsOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *IssueTrackingCollectionTicketsOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *IssueTrackingCollectionTicketsOneRequest) GetTicketID() string { - if o == nil { - return "" - } - return o.TicketID -} - -func (o *IssueTrackingCollectionTicketsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionTicketsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *IssueTrackingCollectionTicketsOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *IssueTrackingCollectionTicketsOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *IssueTrackingCollectionTicketsOneRequest) GetCollectionID() string { - if o == nil { - return "" - } - return o.CollectionID -} - -func (o *IssueTrackingCollectionTicketsOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type IssueTrackingCollectionTicketsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Get a Ticket - GetTicketResponse *components.GetTicketResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *IssueTrackingCollectionTicketsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *IssueTrackingCollectionTicketsOneResponse) GetGetTicketResponse() *components.GetTicketResponse { - if o == nil { - return nil - } - return o.GetTicketResponse -} - -func (o *IssueTrackingCollectionTicketsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketsupdate.go b/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketsupdate.go deleted file mode 100644 index 53f0b285..00000000 --- a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionticketsupdate.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type IssueTrackingCollectionTicketsUpdateGlobals 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 *IssueTrackingCollectionTicketsUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionTicketsUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type IssueTrackingCollectionTicketsUpdateRequest struct { - // ID of the ticket you are acting upon. - TicketID string `pathParam:"style=simple,explode=false,name=ticket_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 collection ID - CollectionID string `pathParam:"style=simple,explode=false,name=collection_id"` - Ticket components.TicketInput `request:"mediaType=application/json"` -} - -func (i IssueTrackingCollectionTicketsUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *IssueTrackingCollectionTicketsUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *IssueTrackingCollectionTicketsUpdateRequest) GetTicketID() string { - if o == nil { - return "" - } - return o.TicketID -} - -func (o *IssueTrackingCollectionTicketsUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionTicketsUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *IssueTrackingCollectionTicketsUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *IssueTrackingCollectionTicketsUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *IssueTrackingCollectionTicketsUpdateRequest) GetCollectionID() string { - if o == nil { - return "" - } - return o.CollectionID -} - -func (o *IssueTrackingCollectionTicketsUpdateRequest) GetTicket() components.TicketInput { - if o == nil { - return components.TicketInput{} - } - return o.Ticket -} - -type IssueTrackingCollectionTicketsUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Update a Ticket - UpdateTicketResponse *components.UpdateTicketResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *IssueTrackingCollectionTicketsUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *IssueTrackingCollectionTicketsUpdateResponse) GetUpdateTicketResponse() *components.UpdateTicketResponse { - if o == nil { - return nil - } - return o.UpdateTicketResponse -} - -func (o *IssueTrackingCollectionTicketsUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionusersall.go b/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionusersall.go deleted file mode 100644 index 2caa6696..00000000 --- a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionusersall.go +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type IssueTrackingCollectionUsersAllGlobals 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 *IssueTrackingCollectionUsersAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionUsersAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type IssueTrackingCollectionUsersAllRequest struct { - // The collection ID - CollectionID string `pathParam:"style=simple,explode=false,name=collection_id"` - // 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"` - // 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 (i IssueTrackingCollectionUsersAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *IssueTrackingCollectionUsersAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *IssueTrackingCollectionUsersAllRequest) GetCollectionID() string { - if o == nil { - return "" - } - return o.CollectionID -} - -func (o *IssueTrackingCollectionUsersAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *IssueTrackingCollectionUsersAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionUsersAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *IssueTrackingCollectionUsersAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *IssueTrackingCollectionUsersAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *IssueTrackingCollectionUsersAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *IssueTrackingCollectionUsersAllRequest) GetPassThrough() map[string]any { - if o == nil { - return nil - } - return o.PassThrough -} - -func (o *IssueTrackingCollectionUsersAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type IssueTrackingCollectionUsersAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Users - GetCollectionUsersResponse *components.GetCollectionUsersResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*IssueTrackingCollectionUsersAllResponse, error) -} - -func (o *IssueTrackingCollectionUsersAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *IssueTrackingCollectionUsersAllResponse) GetGetCollectionUsersResponse() *components.GetCollectionUsersResponse { - if o == nil { - return nil - } - return o.GetCollectionUsersResponse -} - -func (o *IssueTrackingCollectionUsersAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionusersone.go b/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionusersone.go deleted file mode 100644 index a1e3c87d..00000000 --- a/tests/mockserver/internal/sdk/models/operations/issuetrackingcollectionusersone.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type IssueTrackingCollectionUsersOneGlobals 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 *IssueTrackingCollectionUsersOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionUsersOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type IssueTrackingCollectionUsersOneRequest struct { - // The collection ID - CollectionID string `pathParam:"style=simple,explode=false,name=collection_id"` - // 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 (i IssueTrackingCollectionUsersOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(i, "", false) -} - -func (i *IssueTrackingCollectionUsersOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &i, "", false, false); err != nil { - return err - } - return nil -} - -func (o *IssueTrackingCollectionUsersOneRequest) GetCollectionID() string { - if o == nil { - return "" - } - return o.CollectionID -} - -func (o *IssueTrackingCollectionUsersOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *IssueTrackingCollectionUsersOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *IssueTrackingCollectionUsersOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *IssueTrackingCollectionUsersOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *IssueTrackingCollectionUsersOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *IssueTrackingCollectionUsersOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type IssueTrackingCollectionUsersOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // User - GetCollectionUserResponse *components.GetCollectionUserResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *IssueTrackingCollectionUsersOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *IssueTrackingCollectionUsersOneResponse) GetGetCollectionUserResponse() *components.GetCollectionUserResponse { - if o == nil { - return nil - } - return o.GetCollectionUserResponse -} - -func (o *IssueTrackingCollectionUsersOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/smsmessagesadd.go b/tests/mockserver/internal/sdk/models/operations/smsmessagesadd.go deleted file mode 100644 index f95013bf..00000000 --- a/tests/mockserver/internal/sdk/models/operations/smsmessagesadd.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type SmsMessagesAddGlobals 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 *SmsMessagesAddGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *SmsMessagesAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type SmsMessagesAddRequest 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"` - Message components.MessageInput `request:"mediaType=application/json"` -} - -func (s SmsMessagesAddRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(s, "", false) -} - -func (s *SmsMessagesAddRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil { - return err - } - return nil -} - -func (o *SmsMessagesAddRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *SmsMessagesAddRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *SmsMessagesAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *SmsMessagesAddRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *SmsMessagesAddRequest) GetMessage() components.MessageInput { - if o == nil { - return components.MessageInput{} - } - return o.Message -} - -type SmsMessagesAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Messages - CreateMessageResponse *components.CreateMessageResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *SmsMessagesAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *SmsMessagesAddResponse) GetCreateMessageResponse() *components.CreateMessageResponse { - if o == nil { - return nil - } - return o.CreateMessageResponse -} - -func (o *SmsMessagesAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/smsmessagesall.go b/tests/mockserver/internal/sdk/models/operations/smsmessagesall.go deleted file mode 100644 index 92d34942..00000000 --- a/tests/mockserver/internal/sdk/models/operations/smsmessagesall.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type SmsMessagesAllGlobals 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 *SmsMessagesAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *SmsMessagesAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type SmsMessagesAllRequest 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"` - // 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 (s SmsMessagesAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(s, "", false) -} - -func (s *SmsMessagesAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil { - return err - } - return nil -} - -func (o *SmsMessagesAllRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *SmsMessagesAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *SmsMessagesAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *SmsMessagesAllRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *SmsMessagesAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *SmsMessagesAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *SmsMessagesAllRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type SmsMessagesAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Messages - GetMessagesResponse *components.GetMessagesResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*SmsMessagesAllResponse, error) -} - -func (o *SmsMessagesAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *SmsMessagesAllResponse) GetGetMessagesResponse() *components.GetMessagesResponse { - if o == nil { - return nil - } - return o.GetMessagesResponse -} - -func (o *SmsMessagesAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/smsmessagesdelete.go b/tests/mockserver/internal/sdk/models/operations/smsmessagesdelete.go deleted file mode 100644 index f3063bb6..00000000 --- a/tests/mockserver/internal/sdk/models/operations/smsmessagesdelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type SmsMessagesDeleteGlobals 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 *SmsMessagesDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *SmsMessagesDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type SmsMessagesDeleteRequest 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 (s SmsMessagesDeleteRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(s, "", false) -} - -func (s *SmsMessagesDeleteRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil { - return err - } - return nil -} - -func (o *SmsMessagesDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *SmsMessagesDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *SmsMessagesDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *SmsMessagesDeleteRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *SmsMessagesDeleteRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -type SmsMessagesDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Messages - DeleteMessageResponse *components.DeleteMessageResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *SmsMessagesDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *SmsMessagesDeleteResponse) GetDeleteMessageResponse() *components.DeleteMessageResponse { - if o == nil { - return nil - } - return o.DeleteMessageResponse -} - -func (o *SmsMessagesDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/smsmessagesone.go b/tests/mockserver/internal/sdk/models/operations/smsmessagesone.go deleted file mode 100644 index b054ad70..00000000 --- a/tests/mockserver/internal/sdk/models/operations/smsmessagesone.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type SmsMessagesOneGlobals 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 *SmsMessagesOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *SmsMessagesOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type SmsMessagesOneRequest 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 (s SmsMessagesOneRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(s, "", false) -} - -func (s *SmsMessagesOneRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil { - return err - } - return nil -} - -func (o *SmsMessagesOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *SmsMessagesOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *SmsMessagesOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *SmsMessagesOneRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *SmsMessagesOneRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *SmsMessagesOneRequest) GetFields() *string { - if o == nil { - return nil - } - return o.Fields -} - -type SmsMessagesOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Messages - GetMessageResponse *components.GetMessageResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *SmsMessagesOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *SmsMessagesOneResponse) GetGetMessageResponse() *components.GetMessageResponse { - if o == nil { - return nil - } - return o.GetMessageResponse -} - -func (o *SmsMessagesOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/smsmessagesupdate.go b/tests/mockserver/internal/sdk/models/operations/smsmessagesupdate.go deleted file mode 100644 index 0ab97bcd..00000000 --- a/tests/mockserver/internal/sdk/models/operations/smsmessagesupdate.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type SmsMessagesUpdateGlobals 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 *SmsMessagesUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *SmsMessagesUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type SmsMessagesUpdateRequest 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"` - Message components.MessageInput `request:"mediaType=application/json"` -} - -func (s SmsMessagesUpdateRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(s, "", false) -} - -func (s *SmsMessagesUpdateRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil { - return err - } - return nil -} - -func (o *SmsMessagesUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *SmsMessagesUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *SmsMessagesUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *SmsMessagesUpdateRequest) GetServiceID() *string { - if o == nil { - return nil - } - return o.ServiceID -} - -func (o *SmsMessagesUpdateRequest) GetRaw() *bool { - if o == nil { - return nil - } - return o.Raw -} - -func (o *SmsMessagesUpdateRequest) GetMessage() components.MessageInput { - if o == nil { - return components.MessageInput{} - } - return o.Message -} - -type SmsMessagesUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Messages - UpdateMessageResponse *components.UpdateMessageResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *SmsMessagesUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *SmsMessagesUpdateResponse) GetUpdateMessageResponse() *components.UpdateMessageResponse { - if o == nil { - return nil - } - return o.UpdateMessageResponse -} - -func (o *SmsMessagesUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/vaultconnectioncustommappingsall.go b/tests/mockserver/internal/sdk/models/operations/vaultconnectioncustommappingsall.go deleted file mode 100644 index 0facb3da..00000000 --- a/tests/mockserver/internal/sdk/models/operations/vaultconnectioncustommappingsall.go +++ /dev/null @@ -1,114 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type VaultConnectionCustomMappingsAllGlobals 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 *VaultConnectionCustomMappingsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultConnectionCustomMappingsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type VaultConnectionCustomMappingsAllRequest 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"` - // Unified API - UnifiedAPI string `pathParam:"style=simple,explode=false,name=unified_api"` - // Service ID of the resource to return - ServiceID string `pathParam:"style=simple,explode=false,name=service_id"` - // Name of the resource (plural) - Resource string `pathParam:"style=simple,explode=false,name=resource"` - // This is the id of the resource you want to fetch when listing custom fields. For example, if you want to fetch custom fields for a specific contact, you would use the contact id. - ResourceID *string `queryParam:"style=form,explode=true,name=resource_id"` -} - -func (o *VaultConnectionCustomMappingsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultConnectionCustomMappingsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *VaultConnectionCustomMappingsAllRequest) GetUnifiedAPI() string { - if o == nil { - return "" - } - return o.UnifiedAPI -} - -func (o *VaultConnectionCustomMappingsAllRequest) GetServiceID() string { - if o == nil { - return "" - } - return o.ServiceID -} - -func (o *VaultConnectionCustomMappingsAllRequest) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *VaultConnectionCustomMappingsAllRequest) GetResourceID() *string { - if o == nil { - return nil - } - return o.ResourceID -} - -type VaultConnectionCustomMappingsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Custom mapping - GetCustomMappingsResponse *components.GetCustomMappingsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *VaultConnectionCustomMappingsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *VaultConnectionCustomMappingsAllResponse) GetGetCustomMappingsResponse() *components.GetCustomMappingsResponse { - if o == nil { - return nil - } - return o.GetCustomMappingsResponse -} - -func (o *VaultConnectionCustomMappingsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/vaultconnectionsall.go b/tests/mockserver/internal/sdk/models/operations/vaultconnectionsall.go deleted file mode 100644 index 8148e7b6..00000000 --- a/tests/mockserver/internal/sdk/models/operations/vaultconnectionsall.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type VaultConnectionsAllGlobals 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 *VaultConnectionsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultConnectionsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type VaultConnectionsAllRequest 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"` - // Scope results to Unified API - API *string `queryParam:"style=form,explode=true,name=api"` - // Scopes results to connections that have been configured or not - Configured *bool `queryParam:"style=form,explode=true,name=configured"` -} - -func (o *VaultConnectionsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultConnectionsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *VaultConnectionsAllRequest) GetAPI() *string { - if o == nil { - return nil - } - return o.API -} - -func (o *VaultConnectionsAllRequest) GetConfigured() *bool { - if o == nil { - return nil - } - return o.Configured -} - -type VaultConnectionsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Connections - GetConnectionsResponse *components.GetConnectionsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *VaultConnectionsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *VaultConnectionsAllResponse) GetGetConnectionsResponse() *components.GetConnectionsResponse { - if o == nil { - return nil - } - return o.GetConnectionsResponse -} - -func (o *VaultConnectionsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/vaultconnectionsdelete.go b/tests/mockserver/internal/sdk/models/operations/vaultconnectionsdelete.go deleted file mode 100644 index bd4d55d0..00000000 --- a/tests/mockserver/internal/sdk/models/operations/vaultconnectionsdelete.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type VaultConnectionsDeleteGlobals 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 *VaultConnectionsDeleteGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultConnectionsDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type VaultConnectionsDeleteRequest 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"` - // Service ID of the resource to return - ServiceID string `pathParam:"style=simple,explode=false,name=service_id"` - // Unified API - UnifiedAPI string `pathParam:"style=simple,explode=false,name=unified_api"` -} - -func (o *VaultConnectionsDeleteRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultConnectionsDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *VaultConnectionsDeleteRequest) GetServiceID() string { - if o == nil { - return "" - } - return o.ServiceID -} - -func (o *VaultConnectionsDeleteRequest) GetUnifiedAPI() string { - if o == nil { - return "" - } - return o.UnifiedAPI -} - -type VaultConnectionsDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *VaultConnectionsDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *VaultConnectionsDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/vaultconnectionsettingsall.go b/tests/mockserver/internal/sdk/models/operations/vaultconnectionsettingsall.go deleted file mode 100644 index 92d8def1..00000000 --- a/tests/mockserver/internal/sdk/models/operations/vaultconnectionsettingsall.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type VaultConnectionSettingsAllGlobals 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 *VaultConnectionSettingsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultConnectionSettingsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type VaultConnectionSettingsAllRequest 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"` - // Unified API - UnifiedAPI string `pathParam:"style=simple,explode=false,name=unified_api"` - // Service ID of the resource to return - ServiceID string `pathParam:"style=simple,explode=false,name=service_id"` - // Name of the resource (plural) - Resource string `pathParam:"style=simple,explode=false,name=resource"` -} - -func (o *VaultConnectionSettingsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultConnectionSettingsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *VaultConnectionSettingsAllRequest) GetUnifiedAPI() string { - if o == nil { - return "" - } - return o.UnifiedAPI -} - -func (o *VaultConnectionSettingsAllRequest) GetServiceID() string { - if o == nil { - return "" - } - return o.ServiceID -} - -func (o *VaultConnectionSettingsAllRequest) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -type VaultConnectionSettingsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Connection - GetConnectionResponse *components.GetConnectionResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *VaultConnectionSettingsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *VaultConnectionSettingsAllResponse) GetGetConnectionResponse() *components.GetConnectionResponse { - if o == nil { - return nil - } - return o.GetConnectionResponse -} - -func (o *VaultConnectionSettingsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/vaultconnectionsettingsupdate.go b/tests/mockserver/internal/sdk/models/operations/vaultconnectionsettingsupdate.go deleted file mode 100644 index db44509f..00000000 --- a/tests/mockserver/internal/sdk/models/operations/vaultconnectionsettingsupdate.go +++ /dev/null @@ -1,114 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type VaultConnectionSettingsUpdateGlobals 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 *VaultConnectionSettingsUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultConnectionSettingsUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type VaultConnectionSettingsUpdateRequest 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"` - // Service ID of the resource to return - ServiceID string `pathParam:"style=simple,explode=false,name=service_id"` - // Unified API - UnifiedAPI string `pathParam:"style=simple,explode=false,name=unified_api"` - // Name of the resource (plural) - Resource string `pathParam:"style=simple,explode=false,name=resource"` - // Fields that need to be updated on the resource - Connection components.ConnectionInput `request:"mediaType=application/json"` -} - -func (o *VaultConnectionSettingsUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultConnectionSettingsUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *VaultConnectionSettingsUpdateRequest) GetServiceID() string { - if o == nil { - return "" - } - return o.ServiceID -} - -func (o *VaultConnectionSettingsUpdateRequest) GetUnifiedAPI() string { - if o == nil { - return "" - } - return o.UnifiedAPI -} - -func (o *VaultConnectionSettingsUpdateRequest) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *VaultConnectionSettingsUpdateRequest) GetConnection() components.ConnectionInput { - if o == nil { - return components.ConnectionInput{} - } - return o.Connection -} - -type VaultConnectionSettingsUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Connection updated - UpdateConnectionResponse *components.UpdateConnectionResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *VaultConnectionSettingsUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *VaultConnectionSettingsUpdateResponse) GetUpdateConnectionResponse() *components.UpdateConnectionResponse { - if o == nil { - return nil - } - return o.UpdateConnectionResponse -} - -func (o *VaultConnectionSettingsUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/vaultconnectionsimport.go b/tests/mockserver/internal/sdk/models/operations/vaultconnectionsimport.go deleted file mode 100644 index 33b21b60..00000000 --- a/tests/mockserver/internal/sdk/models/operations/vaultconnectionsimport.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type VaultConnectionsImportGlobals 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 *VaultConnectionsImportGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultConnectionsImportGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type VaultConnectionsImportRequest 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"` - // Service ID of the resource to return - ServiceID string `pathParam:"style=simple,explode=false,name=service_id"` - // Unified API - UnifiedAPI string `pathParam:"style=simple,explode=false,name=unified_api"` - // Fields that need to be persisted on the resource - ConnectionImportData components.ConnectionImportData `request:"mediaType=application/json"` -} - -func (o *VaultConnectionsImportRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultConnectionsImportRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *VaultConnectionsImportRequest) GetServiceID() string { - if o == nil { - return "" - } - return o.ServiceID -} - -func (o *VaultConnectionsImportRequest) GetUnifiedAPI() string { - if o == nil { - return "" - } - return o.UnifiedAPI -} - -func (o *VaultConnectionsImportRequest) GetConnectionImportData() components.ConnectionImportData { - if o == nil { - return components.ConnectionImportData{} - } - return o.ConnectionImportData -} - -type VaultConnectionsImportResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Connection created - CreateConnectionResponse *components.CreateConnectionResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *VaultConnectionsImportResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *VaultConnectionsImportResponse) GetCreateConnectionResponse() *components.CreateConnectionResponse { - if o == nil { - return nil - } - return o.CreateConnectionResponse -} - -func (o *VaultConnectionsImportResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/vaultconnectionsone.go b/tests/mockserver/internal/sdk/models/operations/vaultconnectionsone.go deleted file mode 100644 index 04f9bf7c..00000000 --- a/tests/mockserver/internal/sdk/models/operations/vaultconnectionsone.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type VaultConnectionsOneGlobals 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 *VaultConnectionsOneGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultConnectionsOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type VaultConnectionsOneRequest 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"` - // Service ID of the resource to return - ServiceID string `pathParam:"style=simple,explode=false,name=service_id"` - // Unified API - UnifiedAPI string `pathParam:"style=simple,explode=false,name=unified_api"` -} - -func (o *VaultConnectionsOneRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultConnectionsOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *VaultConnectionsOneRequest) GetServiceID() string { - if o == nil { - return "" - } - return o.ServiceID -} - -func (o *VaultConnectionsOneRequest) GetUnifiedAPI() string { - if o == nil { - return "" - } - return o.UnifiedAPI -} - -type VaultConnectionsOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Connection - GetConnectionResponse *components.GetConnectionResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *VaultConnectionsOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *VaultConnectionsOneResponse) GetGetConnectionResponse() *components.GetConnectionResponse { - if o == nil { - return nil - } - return o.GetConnectionResponse -} - -func (o *VaultConnectionsOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/vaultconnectionstoken.go b/tests/mockserver/internal/sdk/models/operations/vaultconnectionstoken.go deleted file mode 100644 index 55e96f5a..00000000 --- a/tests/mockserver/internal/sdk/models/operations/vaultconnectionstoken.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type VaultConnectionsTokenGlobals 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 *VaultConnectionsTokenGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultConnectionsTokenGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type VaultConnectionsTokenRequestBody struct { -} - -type VaultConnectionsTokenRequest 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"` - // Service ID of the resource to return - ServiceID string `pathParam:"style=simple,explode=false,name=service_id"` - // Unified API - UnifiedAPI string `pathParam:"style=simple,explode=false,name=unified_api"` - RequestBody *VaultConnectionsTokenRequestBody `request:"mediaType=application/json"` -} - -func (o *VaultConnectionsTokenRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultConnectionsTokenRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *VaultConnectionsTokenRequest) GetServiceID() string { - if o == nil { - return "" - } - return o.ServiceID -} - -func (o *VaultConnectionsTokenRequest) GetUnifiedAPI() string { - if o == nil { - return "" - } - return o.UnifiedAPI -} - -func (o *VaultConnectionsTokenRequest) GetRequestBody() *VaultConnectionsTokenRequestBody { - if o == nil { - return nil - } - return o.RequestBody -} - -type VaultConnectionsTokenResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Connection - GetConnectionResponse *components.GetConnectionResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *VaultConnectionsTokenResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *VaultConnectionsTokenResponse) GetGetConnectionResponse() *components.GetConnectionResponse { - if o == nil { - return nil - } - return o.GetConnectionResponse -} - -func (o *VaultConnectionsTokenResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/vaultconnectionsupdate.go b/tests/mockserver/internal/sdk/models/operations/vaultconnectionsupdate.go deleted file mode 100644 index 436747a6..00000000 --- a/tests/mockserver/internal/sdk/models/operations/vaultconnectionsupdate.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type VaultConnectionsUpdateGlobals 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 *VaultConnectionsUpdateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultConnectionsUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type VaultConnectionsUpdateRequest 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"` - // Service ID of the resource to return - ServiceID string `pathParam:"style=simple,explode=false,name=service_id"` - // Unified API - UnifiedAPI string `pathParam:"style=simple,explode=false,name=unified_api"` - // Fields that need to be updated on the resource - Connection components.ConnectionInput `request:"mediaType=application/json"` -} - -func (o *VaultConnectionsUpdateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultConnectionsUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *VaultConnectionsUpdateRequest) GetServiceID() string { - if o == nil { - return "" - } - return o.ServiceID -} - -func (o *VaultConnectionsUpdateRequest) GetUnifiedAPI() string { - if o == nil { - return "" - } - return o.UnifiedAPI -} - -func (o *VaultConnectionsUpdateRequest) GetConnection() components.ConnectionInput { - if o == nil { - return components.ConnectionInput{} - } - return o.Connection -} - -type VaultConnectionsUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Connection updated - UpdateConnectionResponse *components.UpdateConnectionResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *VaultConnectionsUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *VaultConnectionsUpdateResponse) GetUpdateConnectionResponse() *components.UpdateConnectionResponse { - if o == nil { - return nil - } - return o.UpdateConnectionResponse -} - -func (o *VaultConnectionsUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/vaultconsumerrequestcountsall.go b/tests/mockserver/internal/sdk/models/operations/vaultconsumerrequestcountsall.go deleted file mode 100644 index ddd1fe88..00000000 --- a/tests/mockserver/internal/sdk/models/operations/vaultconsumerrequestcountsall.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type VaultConsumerRequestCountsAllGlobals struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` -} - -func (o *VaultConsumerRequestCountsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type VaultConsumerRequestCountsAllRequest struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` - // ID of the consumer to return - ConsumerID string `pathParam:"style=simple,explode=false,name=consumer_id"` - // Scopes results to requests that happened after datetime - StartDatetime string `queryParam:"style=form,explode=true,name=start_datetime"` - // Scopes results to requests that happened before datetime - EndDatetime string `queryParam:"style=form,explode=true,name=end_datetime"` -} - -func (o *VaultConsumerRequestCountsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *VaultConsumerRequestCountsAllRequest) GetConsumerID() string { - if o == nil { - return "" - } - return o.ConsumerID -} - -func (o *VaultConsumerRequestCountsAllRequest) GetStartDatetime() string { - if o == nil { - return "" - } - return o.StartDatetime -} - -func (o *VaultConsumerRequestCountsAllRequest) GetEndDatetime() string { - if o == nil { - return "" - } - return o.EndDatetime -} - -type VaultConsumerRequestCountsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Consumers Request Counts within Date Range - ConsumerRequestCountsInDateRangeResponse *components.ConsumerRequestCountsInDateRangeResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *VaultConsumerRequestCountsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *VaultConsumerRequestCountsAllResponse) GetConsumerRequestCountsInDateRangeResponse() *components.ConsumerRequestCountsInDateRangeResponse { - if o == nil { - return nil - } - return o.ConsumerRequestCountsInDateRangeResponse -} - -func (o *VaultConsumerRequestCountsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/vaultconsumersadd.go b/tests/mockserver/internal/sdk/models/operations/vaultconsumersadd.go deleted file mode 100644 index f5f9dd1d..00000000 --- a/tests/mockserver/internal/sdk/models/operations/vaultconsumersadd.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type VaultConsumersAddGlobals struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` -} - -func (o *VaultConsumersAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type VaultConsumersAddRequest struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` - Consumer components.ConsumerInput `request:"mediaType=application/json"` -} - -func (o *VaultConsumersAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *VaultConsumersAddRequest) GetConsumer() components.ConsumerInput { - if o == nil { - return components.ConsumerInput{} - } - return o.Consumer -} - -type VaultConsumersAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Consumer created - CreateConsumerResponse *components.CreateConsumerResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *VaultConsumersAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *VaultConsumersAddResponse) GetCreateConsumerResponse() *components.CreateConsumerResponse { - if o == nil { - return nil - } - return o.CreateConsumerResponse -} - -func (o *VaultConsumersAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/vaultconsumersall.go b/tests/mockserver/internal/sdk/models/operations/vaultconsumersall.go deleted file mode 100644 index 5e5e8c97..00000000 --- a/tests/mockserver/internal/sdk/models/operations/vaultconsumersall.go +++ /dev/null @@ -1,92 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type VaultConsumersAllGlobals struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` -} - -func (o *VaultConsumersAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type VaultConsumersAllRequest struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-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"` -} - -func (v VaultConsumersAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(v, "", false) -} - -func (v *VaultConsumersAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { - return err - } - return nil -} - -func (o *VaultConsumersAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *VaultConsumersAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *VaultConsumersAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -type VaultConsumersAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Consumers - GetConsumersResponse *components.GetConsumersResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*VaultConsumersAllResponse, error) -} - -func (o *VaultConsumersAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *VaultConsumersAllResponse) GetGetConsumersResponse() *components.GetConsumersResponse { - if o == nil { - return nil - } - return o.GetConsumersResponse -} - -func (o *VaultConsumersAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/vaultconsumersdelete.go b/tests/mockserver/internal/sdk/models/operations/vaultconsumersdelete.go deleted file mode 100644 index c93de540..00000000 --- a/tests/mockserver/internal/sdk/models/operations/vaultconsumersdelete.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type VaultConsumersDeleteGlobals struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` -} - -func (o *VaultConsumersDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type VaultConsumersDeleteRequest struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` - // ID of the consumer to return - ConsumerID string `pathParam:"style=simple,explode=false,name=consumer_id"` -} - -func (o *VaultConsumersDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *VaultConsumersDeleteRequest) GetConsumerID() string { - if o == nil { - return "" - } - return o.ConsumerID -} - -type VaultConsumersDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Consumer deleted - DeleteConsumerResponse *components.DeleteConsumerResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *VaultConsumersDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *VaultConsumersDeleteResponse) GetDeleteConsumerResponse() *components.DeleteConsumerResponse { - if o == nil { - return nil - } - return o.DeleteConsumerResponse -} - -func (o *VaultConsumersDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/vaultconsumersone.go b/tests/mockserver/internal/sdk/models/operations/vaultconsumersone.go deleted file mode 100644 index 288b958f..00000000 --- a/tests/mockserver/internal/sdk/models/operations/vaultconsumersone.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type VaultConsumersOneGlobals struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` -} - -func (o *VaultConsumersOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type VaultConsumersOneRequest struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` - // ID of the consumer to return - ConsumerID string `pathParam:"style=simple,explode=false,name=consumer_id"` -} - -func (o *VaultConsumersOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *VaultConsumersOneRequest) GetConsumerID() string { - if o == nil { - return "" - } - return o.ConsumerID -} - -type VaultConsumersOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Consumer - GetConsumerResponse *components.GetConsumerResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *VaultConsumersOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *VaultConsumersOneResponse) GetGetConsumerResponse() *components.GetConsumerResponse { - if o == nil { - return nil - } - return o.GetConsumerResponse -} - -func (o *VaultConsumersOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/vaultconsumersupdate.go b/tests/mockserver/internal/sdk/models/operations/vaultconsumersupdate.go deleted file mode 100644 index cc4e0368..00000000 --- a/tests/mockserver/internal/sdk/models/operations/vaultconsumersupdate.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type VaultConsumersUpdateGlobals struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` -} - -func (o *VaultConsumersUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type VaultConsumersUpdateRequest struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` - // ID of the consumer to return - ConsumerID string `pathParam:"style=simple,explode=false,name=consumer_id"` - UpdateConsumerRequest components.UpdateConsumerRequest `request:"mediaType=application/json"` -} - -func (o *VaultConsumersUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *VaultConsumersUpdateRequest) GetConsumerID() string { - if o == nil { - return "" - } - return o.ConsumerID -} - -func (o *VaultConsumersUpdateRequest) GetUpdateConsumerRequest() components.UpdateConsumerRequest { - if o == nil { - return components.UpdateConsumerRequest{} - } - return o.UpdateConsumerRequest -} - -type VaultConsumersUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Consumer updated - UpdateConsumerResponse *components.UpdateConsumerResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *VaultConsumersUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *VaultConsumersUpdateResponse) GetUpdateConsumerResponse() *components.UpdateConsumerResponse { - if o == nil { - return nil - } - return o.UpdateConsumerResponse -} - -func (o *VaultConsumersUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/vaultcreatecallbackstate.go b/tests/mockserver/internal/sdk/models/operations/vaultcreatecallbackstate.go deleted file mode 100644 index fe29fe53..00000000 --- a/tests/mockserver/internal/sdk/models/operations/vaultcreatecallbackstate.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type VaultCreateCallbackStateGlobals 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 *VaultCreateCallbackStateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultCreateCallbackStateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type VaultCreateCallbackStateRequest 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"` - // Service ID of the resource to return - ServiceID string `pathParam:"style=simple,explode=false,name=service_id"` - // Unified API - UnifiedAPI string `pathParam:"style=simple,explode=false,name=unified_api"` - // Callback state data - CreateCallbackState components.CreateCallbackState `request:"mediaType=application/json"` -} - -func (o *VaultCreateCallbackStateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultCreateCallbackStateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *VaultCreateCallbackStateRequest) GetServiceID() string { - if o == nil { - return "" - } - return o.ServiceID -} - -func (o *VaultCreateCallbackStateRequest) GetUnifiedAPI() string { - if o == nil { - return "" - } - return o.UnifiedAPI -} - -func (o *VaultCreateCallbackStateRequest) GetCreateCallbackState() components.CreateCallbackState { - if o == nil { - return components.CreateCallbackState{} - } - return o.CreateCallbackState -} - -type VaultCreateCallbackStateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Callback state created - CreateCallbackStateResponse *components.CreateCallbackStateResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *VaultCreateCallbackStateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *VaultCreateCallbackStateResponse) GetCreateCallbackStateResponse() *components.CreateCallbackStateResponse { - if o == nil { - return nil - } - return o.CreateCallbackStateResponse -} - -func (o *VaultCreateCallbackStateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/vaultcustomfieldsall.go b/tests/mockserver/internal/sdk/models/operations/vaultcustomfieldsall.go deleted file mode 100644 index 44a55461..00000000 --- a/tests/mockserver/internal/sdk/models/operations/vaultcustomfieldsall.go +++ /dev/null @@ -1,114 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type VaultCustomFieldsAllGlobals 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 *VaultCustomFieldsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultCustomFieldsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type VaultCustomFieldsAllRequest 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"` - // Unified API - UnifiedAPI string `pathParam:"style=simple,explode=false,name=unified_api"` - // Service ID of the resource to return - ServiceID string `pathParam:"style=simple,explode=false,name=service_id"` - // Name of the resource (plural) - Resource string `pathParam:"style=simple,explode=false,name=resource"` - // This is the id of the resource you want to fetch when listing custom fields. For example, if you want to fetch custom fields for a specific contact, you would use the contact id. - ResourceID *string `queryParam:"style=form,explode=true,name=resource_id"` -} - -func (o *VaultCustomFieldsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultCustomFieldsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *VaultCustomFieldsAllRequest) GetUnifiedAPI() string { - if o == nil { - return "" - } - return o.UnifiedAPI -} - -func (o *VaultCustomFieldsAllRequest) GetServiceID() string { - if o == nil { - return "" - } - return o.ServiceID -} - -func (o *VaultCustomFieldsAllRequest) GetResource() string { - if o == nil { - return "" - } - return o.Resource -} - -func (o *VaultCustomFieldsAllRequest) GetResourceID() *string { - if o == nil { - return nil - } - return o.ResourceID -} - -type VaultCustomFieldsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Custom mapping - GetCustomFieldsResponse *components.GetCustomFieldsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *VaultCustomFieldsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *VaultCustomFieldsAllResponse) GetGetCustomFieldsResponse() *components.GetCustomFieldsResponse { - if o == nil { - return nil - } - return o.GetCustomFieldsResponse -} - -func (o *VaultCustomFieldsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/vaultcustommappingsall.go b/tests/mockserver/internal/sdk/models/operations/vaultcustommappingsall.go deleted file mode 100644 index a7bd3b41..00000000 --- a/tests/mockserver/internal/sdk/models/operations/vaultcustommappingsall.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type VaultCustomMappingsAllGlobals 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 *VaultCustomMappingsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultCustomMappingsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type VaultCustomMappingsAllRequest 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"` - // Unified API - UnifiedAPI string `pathParam:"style=simple,explode=false,name=unified_api"` - // Service ID of the resource to return - ServiceID string `pathParam:"style=simple,explode=false,name=service_id"` -} - -func (o *VaultCustomMappingsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultCustomMappingsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *VaultCustomMappingsAllRequest) GetUnifiedAPI() string { - if o == nil { - return "" - } - return o.UnifiedAPI -} - -func (o *VaultCustomMappingsAllRequest) GetServiceID() string { - if o == nil { - return "" - } - return o.ServiceID -} - -type VaultCustomMappingsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Custom mapping - GetCustomMappingsResponse *components.GetCustomMappingsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *VaultCustomMappingsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *VaultCustomMappingsAllResponse) GetGetCustomMappingsResponse() *components.GetCustomMappingsResponse { - if o == nil { - return nil - } - return o.GetCustomMappingsResponse -} - -func (o *VaultCustomMappingsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/vaultlogsall.go b/tests/mockserver/internal/sdk/models/operations/vaultlogsall.go deleted file mode 100644 index 43420c84..00000000 --- a/tests/mockserver/internal/sdk/models/operations/vaultlogsall.go +++ /dev/null @@ -1,119 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type VaultLogsAllGlobals struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-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"` -} - -func (o *VaultLogsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *VaultLogsAllGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -type VaultLogsAllRequest struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-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"` - // Filter results - Filter *components.LogsFilter `queryParam:"style=deepObject,explode=true,name=filter"` - // 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"` -} - -func (v VaultLogsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(v, "", false) -} - -func (v *VaultLogsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil { - return err - } - return nil -} - -func (o *VaultLogsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *VaultLogsAllRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultLogsAllRequest) GetFilter() *components.LogsFilter { - if o == nil { - return nil - } - return o.Filter -} - -func (o *VaultLogsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *VaultLogsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -type VaultLogsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Logs - GetLogsResponse *components.GetLogsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*VaultLogsAllResponse, error) -} - -func (o *VaultLogsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *VaultLogsAllResponse) GetGetLogsResponse() *components.GetLogsResponse { - if o == nil { - return nil - } - return o.GetLogsResponse -} - -func (o *VaultLogsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/vaultsessionscreate.go b/tests/mockserver/internal/sdk/models/operations/vaultsessionscreate.go deleted file mode 100644 index e6599fbc..00000000 --- a/tests/mockserver/internal/sdk/models/operations/vaultsessionscreate.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type VaultSessionsCreateGlobals 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 *VaultSessionsCreateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultSessionsCreateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type VaultSessionsCreateRequest 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"` - // Additional redirect uri and/or consumer metadata - Session *components.Session `request:"mediaType=application/json"` -} - -func (o *VaultSessionsCreateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultSessionsCreateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *VaultSessionsCreateRequest) GetSession() *components.Session { - if o == nil { - return nil - } - return o.Session -} - -type VaultSessionsCreateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Session created - CreateSessionResponse *components.CreateSessionResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *VaultSessionsCreateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *VaultSessionsCreateResponse) GetCreateSessionResponse() *components.CreateSessionResponse { - if o == nil { - return nil - } - return o.CreateSessionResponse -} - -func (o *VaultSessionsCreateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/vaultvalidateconnectionstate.go b/tests/mockserver/internal/sdk/models/operations/vaultvalidateconnectionstate.go deleted file mode 100644 index aee46915..00000000 --- a/tests/mockserver/internal/sdk/models/operations/vaultvalidateconnectionstate.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type VaultValidateConnectionStateGlobals 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 *VaultValidateConnectionStateGlobals) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultValidateConnectionStateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type VaultValidateConnectionStateRequestBody struct { -} - -type VaultValidateConnectionStateRequest 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"` - // Service ID of the resource to return - ServiceID string `pathParam:"style=simple,explode=false,name=service_id"` - // Unified API - UnifiedAPI string `pathParam:"style=simple,explode=false,name=unified_api"` - RequestBody *VaultValidateConnectionStateRequestBody `request:"mediaType=application/json"` -} - -func (o *VaultValidateConnectionStateRequest) GetConsumerID() *string { - if o == nil { - return nil - } - return o.ConsumerID -} - -func (o *VaultValidateConnectionStateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *VaultValidateConnectionStateRequest) GetServiceID() string { - if o == nil { - return "" - } - return o.ServiceID -} - -func (o *VaultValidateConnectionStateRequest) GetUnifiedAPI() string { - if o == nil { - return "" - } - return o.UnifiedAPI -} - -func (o *VaultValidateConnectionStateRequest) GetRequestBody() *VaultValidateConnectionStateRequestBody { - if o == nil { - return nil - } - return o.RequestBody -} - -type VaultValidateConnectionStateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Connection access token refreshed - ValidateConnectionStateResponse *components.ValidateConnectionStateResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *VaultValidateConnectionStateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *VaultValidateConnectionStateResponse) GetValidateConnectionStateResponse() *components.ValidateConnectionStateResponse { - if o == nil { - return nil - } - return o.ValidateConnectionStateResponse -} - -func (o *VaultValidateConnectionStateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/webhookeventlogsall.go b/tests/mockserver/internal/sdk/models/operations/webhookeventlogsall.go deleted file mode 100644 index 18bf98ef..00000000 --- a/tests/mockserver/internal/sdk/models/operations/webhookeventlogsall.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type WebhookEventLogsAllGlobals struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` -} - -func (o *WebhookEventLogsAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type WebhookEventLogsAllRequest struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-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"` - // Filter results - Filter *components.WebhookEventLogsFilter `queryParam:"style=deepObject,explode=true,name=filter"` -} - -func (w WebhookEventLogsAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(w, "", false) -} - -func (w *WebhookEventLogsAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &w, "", false, false); err != nil { - return err - } - return nil -} - -func (o *WebhookEventLogsAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *WebhookEventLogsAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *WebhookEventLogsAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -func (o *WebhookEventLogsAllRequest) GetFilter() *components.WebhookEventLogsFilter { - if o == nil { - return nil - } - return o.Filter -} - -type WebhookEventLogsAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // EventLogs - GetWebhookEventLogsResponse *components.GetWebhookEventLogsResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*WebhookEventLogsAllResponse, error) -} - -func (o *WebhookEventLogsAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *WebhookEventLogsAllResponse) GetGetWebhookEventLogsResponse() *components.GetWebhookEventLogsResponse { - if o == nil { - return nil - } - return o.GetWebhookEventLogsResponse -} - -func (o *WebhookEventLogsAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/webhookwebhooksadd.go b/tests/mockserver/internal/sdk/models/operations/webhookwebhooksadd.go deleted file mode 100644 index 97a835b3..00000000 --- a/tests/mockserver/internal/sdk/models/operations/webhookwebhooksadd.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type WebhookWebhooksAddGlobals struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` -} - -func (o *WebhookWebhooksAddGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type WebhookWebhooksAddRequest struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` - CreateWebhookRequest components.CreateWebhookRequest `request:"mediaType=application/json"` -} - -func (o *WebhookWebhooksAddRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *WebhookWebhooksAddRequest) GetCreateWebhookRequest() components.CreateWebhookRequest { - if o == nil { - return components.CreateWebhookRequest{} - } - return o.CreateWebhookRequest -} - -type WebhookWebhooksAddResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Webhooks - CreateWebhookResponse *components.CreateWebhookResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *WebhookWebhooksAddResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *WebhookWebhooksAddResponse) GetCreateWebhookResponse() *components.CreateWebhookResponse { - if o == nil { - return nil - } - return o.CreateWebhookResponse -} - -func (o *WebhookWebhooksAddResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/webhookwebhooksall.go b/tests/mockserver/internal/sdk/models/operations/webhookwebhooksall.go deleted file mode 100644 index a69d8ac8..00000000 --- a/tests/mockserver/internal/sdk/models/operations/webhookwebhooksall.go +++ /dev/null @@ -1,92 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" - "mockserver/internal/sdk/utils" -) - -type WebhookWebhooksAllGlobals struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` -} - -func (o *WebhookWebhooksAllGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type WebhookWebhooksAllRequest struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-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"` -} - -func (w WebhookWebhooksAllRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(w, "", false) -} - -func (w *WebhookWebhooksAllRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &w, "", false, false); err != nil { - return err - } - return nil -} - -func (o *WebhookWebhooksAllRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *WebhookWebhooksAllRequest) GetCursor() *string { - if o == nil { - return nil - } - return o.Cursor -} - -func (o *WebhookWebhooksAllRequest) GetLimit() *int64 { - if o == nil { - return nil - } - return o.Limit -} - -type WebhookWebhooksAllResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Webhooks - GetWebhooksResponse *components.GetWebhooksResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse - - Next func() (*WebhookWebhooksAllResponse, error) -} - -func (o *WebhookWebhooksAllResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *WebhookWebhooksAllResponse) GetGetWebhooksResponse() *components.GetWebhooksResponse { - if o == nil { - return nil - } - return o.GetWebhooksResponse -} - -func (o *WebhookWebhooksAllResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/webhookwebhooksdelete.go b/tests/mockserver/internal/sdk/models/operations/webhookwebhooksdelete.go deleted file mode 100644 index b34a8859..00000000 --- a/tests/mockserver/internal/sdk/models/operations/webhookwebhooksdelete.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type WebhookWebhooksDeleteGlobals struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` -} - -func (o *WebhookWebhooksDeleteGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type WebhookWebhooksDeleteRequest struct { - // JWT Webhook token that represents the unifiedApi and applicationId associated to the event source. - ID string `pathParam:"style=simple,explode=false,name=id"` - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` -} - -func (o *WebhookWebhooksDeleteRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *WebhookWebhooksDeleteRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type WebhookWebhooksDeleteResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Webhooks - DeleteWebhookResponse *components.DeleteWebhookResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *WebhookWebhooksDeleteResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *WebhookWebhooksDeleteResponse) GetDeleteWebhookResponse() *components.DeleteWebhookResponse { - if o == nil { - return nil - } - return o.DeleteWebhookResponse -} - -func (o *WebhookWebhooksDeleteResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/webhookwebhooksone.go b/tests/mockserver/internal/sdk/models/operations/webhookwebhooksone.go deleted file mode 100644 index 3dbf0469..00000000 --- a/tests/mockserver/internal/sdk/models/operations/webhookwebhooksone.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type WebhookWebhooksOneGlobals struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` -} - -func (o *WebhookWebhooksOneGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type WebhookWebhooksOneRequest struct { - // JWT Webhook token that represents the unifiedApi and applicationId associated to the event source. - ID string `pathParam:"style=simple,explode=false,name=id"` - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` -} - -func (o *WebhookWebhooksOneRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *WebhookWebhooksOneRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type WebhookWebhooksOneResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Webhooks - GetWebhookResponse *components.GetWebhookResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *WebhookWebhooksOneResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *WebhookWebhooksOneResponse) GetGetWebhookResponse() *components.GetWebhookResponse { - if o == nil { - return nil - } - return o.GetWebhookResponse -} - -func (o *WebhookWebhooksOneResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/operations/webhookwebhooksupdate.go b/tests/mockserver/internal/sdk/models/operations/webhookwebhooksupdate.go deleted file mode 100644 index 2e369926..00000000 --- a/tests/mockserver/internal/sdk/models/operations/webhookwebhooksupdate.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "mockserver/internal/sdk/models/components" -) - -type WebhookWebhooksUpdateGlobals struct { - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` -} - -func (o *WebhookWebhooksUpdateGlobals) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -type WebhookWebhooksUpdateRequest struct { - // JWT Webhook token that represents the unifiedApi and applicationId associated to the event source. - ID string `pathParam:"style=simple,explode=false,name=id"` - // The ID of your Unify application - AppID *string `header:"style=simple,explode=false,name=x-apideck-app-id"` - UpdateWebhookRequest components.UpdateWebhookRequest `request:"mediaType=application/json"` -} - -func (o *WebhookWebhooksUpdateRequest) GetID() string { - if o == nil { - return "" - } - return o.ID -} - -func (o *WebhookWebhooksUpdateRequest) GetAppID() *string { - if o == nil { - return nil - } - return o.AppID -} - -func (o *WebhookWebhooksUpdateRequest) GetUpdateWebhookRequest() components.UpdateWebhookRequest { - if o == nil { - return components.UpdateWebhookRequest{} - } - return o.UpdateWebhookRequest -} - -type WebhookWebhooksUpdateResponse struct { - HTTPMeta components.HTTPMetadata `json:"-"` - // Webhooks - UpdateWebhookResponse *components.UpdateWebhookResponse - // Unexpected error - UnexpectedErrorResponse *components.UnexpectedErrorResponse -} - -func (o *WebhookWebhooksUpdateResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { - return components.HTTPMetadata{} - } - return o.HTTPMeta -} - -func (o *WebhookWebhooksUpdateResponse) GetUpdateWebhookResponse() *components.UpdateWebhookResponse { - if o == nil { - return nil - } - return o.UpdateWebhookResponse -} - -func (o *WebhookWebhooksUpdateResponse) GetUnexpectedErrorResponse() *components.UnexpectedErrorResponse { - if o == nil { - return nil - } - return o.UnexpectedErrorResponse -} diff --git a/tests/mockserver/internal/sdk/models/sdkerrors/badrequestresponseerror.go b/tests/mockserver/internal/sdk/models/sdkerrors/badrequestresponseerror.go deleted file mode 100644 index 45b14752..00000000 --- a/tests/mockserver/internal/sdk/models/sdkerrors/badrequestresponseerror.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "mockserver/internal/sdk/models/components" -) - -// BadRequestResponseError - Bad Request -type BadRequestResponseError struct { - // HTTP status code - StatusCode *float64 `json:"status_code,omitempty"` - // Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) - Error_ *string `json:"error,omitempty"` - // The type of error returned - TypeName *string `json:"type_name,omitempty"` - // A human-readable message providing more details about the error. - Message *string `json:"message,omitempty"` - // Contains parameter or domain specific information related to the error and why it occurred. - Detail *components.BadRequestResponseDetail `json:"detail,omitempty"` - // Link to documentation of error type - Ref *string `json:"ref,omitempty"` - HTTPMeta components.HTTPMetadata `json:"-"` -} - -var _ error = &BadRequestResponseError{} - -func (e *BadRequestResponseError) Error() string { - if e.Message == nil { - return "unknown error" - } - - return *e.Message -} diff --git a/tests/mockserver/internal/sdk/models/sdkerrors/notfoundresponseerror.go b/tests/mockserver/internal/sdk/models/sdkerrors/notfoundresponseerror.go deleted file mode 100644 index a87dcf7b..00000000 --- a/tests/mockserver/internal/sdk/models/sdkerrors/notfoundresponseerror.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "mockserver/internal/sdk/models/components" -) - -// NotFoundResponseError - The specified resource was not found -type NotFoundResponseError struct { - // HTTP status code - StatusCode *float64 `json:"status_code,omitempty"` - // Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) - Error_ *string `json:"error,omitempty"` - // The type of error returned - TypeName *string `json:"type_name,omitempty"` - // A human-readable message providing more details about the error. - Message *string `json:"message,omitempty"` - // Contains parameter or domain specific information related to the error and why it occurred. - Detail *components.NotFoundResponseDetail `json:"detail,omitempty"` - // Link to documentation of error type - Ref *string `json:"ref,omitempty"` - HTTPMeta components.HTTPMetadata `json:"-"` -} - -var _ error = &NotFoundResponseError{} - -func (e *NotFoundResponseError) Error() string { - if e.Message == nil { - return "unknown error" - } - - return *e.Message -} diff --git a/tests/mockserver/internal/sdk/models/sdkerrors/paymentrequiredresponseerror.go b/tests/mockserver/internal/sdk/models/sdkerrors/paymentrequiredresponseerror.go deleted file mode 100644 index 59f47560..00000000 --- a/tests/mockserver/internal/sdk/models/sdkerrors/paymentrequiredresponseerror.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "mockserver/internal/sdk/models/components" -) - -// PaymentRequiredResponseError - Payment Required -type PaymentRequiredResponseError struct { - // HTTP status code - StatusCode *float64 `json:"status_code,omitempty"` - // Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) - Error_ *string `json:"error,omitempty"` - // The type of error returned - TypeName *string `json:"type_name,omitempty"` - // A human-readable message providing more details about the error. - Message *string `json:"message,omitempty"` - // Contains parameter or domain specific information related to the error and why it occurred. - Detail *string `json:"detail,omitempty"` - // Link to documentation of error type - Ref *string `json:"ref,omitempty"` - HTTPMeta components.HTTPMetadata `json:"-"` -} - -var _ error = &PaymentRequiredResponseError{} - -func (e *PaymentRequiredResponseError) Error() string { - if e.Message == nil { - return "unknown error" - } - - return *e.Message -} diff --git a/tests/mockserver/internal/sdk/models/sdkerrors/unauthorizedresponseerror.go b/tests/mockserver/internal/sdk/models/sdkerrors/unauthorizedresponseerror.go deleted file mode 100644 index 464e458d..00000000 --- a/tests/mockserver/internal/sdk/models/sdkerrors/unauthorizedresponseerror.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "mockserver/internal/sdk/models/components" -) - -// UnauthorizedResponseError - Unauthorized -type UnauthorizedResponseError struct { - // HTTP status code - StatusCode *float64 `json:"status_code,omitempty"` - // Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) - Error_ *string `json:"error,omitempty"` - // The type of error returned - TypeName *string `json:"type_name,omitempty"` - // A human-readable message providing more details about the error. - Message *string `json:"message,omitempty"` - // Contains parameter or domain specific information related to the error and why it occurred. - Detail *components.UnauthorizedResponseDetail `json:"detail,omitempty"` - // Link to documentation of error type - Ref *string `json:"ref,omitempty"` - HTTPMeta components.HTTPMetadata `json:"-"` -} - -var _ error = &UnauthorizedResponseError{} - -func (e *UnauthorizedResponseError) Error() string { - if e.Message == nil { - return "unknown error" - } - - return *e.Message -} diff --git a/tests/mockserver/internal/sdk/models/sdkerrors/unprocessableresponseerror.go b/tests/mockserver/internal/sdk/models/sdkerrors/unprocessableresponseerror.go deleted file mode 100644 index a5db7ab8..00000000 --- a/tests/mockserver/internal/sdk/models/sdkerrors/unprocessableresponseerror.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package sdkerrors - -import ( - "mockserver/internal/sdk/models/components" -) - -// UnprocessableResponseError - Unprocessable -type UnprocessableResponseError struct { - // HTTP status code - StatusCode *float64 `json:"status_code,omitempty"` - // Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) - Error_ *string `json:"error,omitempty"` - // The type of error returned - TypeName *string `json:"type_name,omitempty"` - // A human-readable message providing more details about the error. - Message *string `json:"message,omitempty"` - // Contains parameter or domain specific information related to the error and why it occurred. - Detail *components.UnprocessableResponseDetail `json:"detail,omitempty"` - // Link to documentation of error type - Ref *string `json:"ref,omitempty"` - HTTPMeta components.HTTPMetadata `json:"-"` -} - -var _ error = &UnprocessableResponseError{} - -func (e *UnprocessableResponseError) Error() string { - if e.Message == nil { - return "unknown error" - } - - return *e.Message -} diff --git a/tests/mockserver/internal/sdk/types/bigint.go b/tests/mockserver/internal/sdk/types/bigint.go deleted file mode 100644 index 9c6a086d..00000000 --- a/tests/mockserver/internal/sdk/types/bigint.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package types - -import ( - "fmt" - "math/big" -) - -// MustNewBigIntFromString returns an instance of big.Int from a string -// The string is assumed to be base 10 and if it is not a valid big.Int -// then the function panics. -// Avoid using this function in production code. -func MustNewBigIntFromString(s string) *big.Int { - i, ok := new(big.Int).SetString(s, 10) - if !ok { - panic(fmt.Errorf("failed to parse string as big.Int")) - } - - return i -} diff --git a/tests/mockserver/internal/sdk/types/date.go b/tests/mockserver/internal/sdk/types/date.go deleted file mode 100644 index 5b2782f2..00000000 --- a/tests/mockserver/internal/sdk/types/date.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package types - -import ( - "encoding/json" - "fmt" - "strings" - "time" -) - -// Date is a wrapper around time.Time that allows for JSON marshaling a date string formatted as "2006-01-02". -type Date struct { - time.Time -} - -var ( - _ json.Marshaler = &Date{} - _ json.Unmarshaler = &Date{} - _ fmt.Stringer = &Date{} -) - -// NewDate returns an instance of Date from a time.Time. -func NewDate(t time.Time) *Date { - d := DateFromTime(t) - return &d -} - -// DateFromTime returns a Date from a time.Time. -func DateFromTime(t time.Time) Date { - return Date{t} -} - -// NewDateFromString returns an instance of Date from a string formatted as "2006-01-02". -func NewDateFromString(str string) (*Date, error) { - d, err := DateFromString(str) - if err != nil { - return nil, err - } - - return &d, nil -} - -// DateFromString returns a Date from a string formatted as "2006-01-02". -func DateFromString(str string) (Date, error) { - var d Date - var err error - - d.Time, err = time.Parse("2006-01-02", str) - return d, err -} - -// MustNewDateFromString returns an instance of Date from a string formatted as "2006-01-02" or panics. -// Avoid using this function in production code. -func MustNewDateFromString(str string) *Date { - d := MustDateFromString(str) - return &d -} - -// MustDateFromString returns a Date from a string formatted as "2006-01-02" or panics. -// Avoid using this function in production code. -func MustDateFromString(str string) Date { - d, err := DateFromString(str) - if err != nil { - panic(err) - } - return d -} - -func (d Date) GetTime() time.Time { - return d.Time -} - -func (d Date) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf(`"%s"`, d.Time.Format("2006-01-02"))), nil -} - -func (d *Date) UnmarshalJSON(data []byte) error { - var err error - - str := string(data) - str = strings.Trim(str, `"`) - - d.Time, err = time.Parse("2006-01-02", str) - return err -} - -func (d Date) String() string { - return d.Time.Format("2006-01-02") -} diff --git a/tests/mockserver/internal/sdk/types/datetime.go b/tests/mockserver/internal/sdk/types/datetime.go deleted file mode 100644 index 3eff332d..00000000 --- a/tests/mockserver/internal/sdk/types/datetime.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package types - -import "time" - -// MustTimeFromString returns a time.Time from a string formatted as "2006-01-02T15:04:05Z07:00" or panics. -// Avoid using this function in production code. -func MustTimeFromString(str string) time.Time { - t, err := time.Parse(time.RFC3339, str) - if err != nil { - panic(err) - } - - return t -} - -// MustNewTimeFromString returns an instance of time.Time from a string formatted as "2006-01-02T15:04:05Z07:00" or panics. -// Avoid using this function in production code. -func MustNewTimeFromString(str string) *time.Time { - t := MustTimeFromString(str) - return &t -} diff --git a/tests/mockserver/internal/sdk/types/decimal.go b/tests/mockserver/internal/sdk/types/decimal.go deleted file mode 100644 index d8429bc6..00000000 --- a/tests/mockserver/internal/sdk/types/decimal.go +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package types - -import ( - "fmt" - - "github.com/ericlagergren/decimal" -) - -// MustNewDecimalFromString returns an instance of Decimal from a string -// Avoid using this function in production code. -func MustNewDecimalFromString(s string) *decimal.Big { - d, ok := new(decimal.Big).SetString(s) - if !ok { - panic(fmt.Errorf("failed to parse string as decimal.Big")) - } - - return d -} diff --git a/tests/mockserver/internal/sdk/types/jsonl/jsonl.go b/tests/mockserver/internal/sdk/types/jsonl/jsonl.go deleted file mode 100644 index 26df95cf..00000000 --- a/tests/mockserver/internal/sdk/types/jsonl/jsonl.go +++ /dev/null @@ -1,7 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package jsonl - -type JsonLStream[T any] struct { - // TODO to be implemented -} diff --git a/tests/mockserver/internal/sdk/types/pointers.go b/tests/mockserver/internal/sdk/types/pointers.go deleted file mode 100644 index 35c439d2..00000000 --- a/tests/mockserver/internal/sdk/types/pointers.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package types - -func String(s string) *string { return &s } -func Bool(b bool) *bool { return &b } -func Int(i int) *int { return &i } -func Int64(i int64) *int64 { return &i } -func Float32(f float32) *float32 { return &f } -func Float64(f float64) *float64 { return &f } -func Pointer[T any](v T) *T { return &v } diff --git a/tests/mockserver/internal/sdk/utils/json.go b/tests/mockserver/internal/sdk/utils/json.go deleted file mode 100644 index ca93aa5b..00000000 --- a/tests/mockserver/internal/sdk/utils/json.go +++ /dev/null @@ -1,675 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package utils - -import ( - "bytes" - "encoding/json" - "fmt" - "math/big" - "reflect" - "strconv" - "strings" - "time" - "unsafe" - - "mockserver/internal/sdk/types" - - "github.com/ericlagergren/decimal" -) - -func MarshalJSON(v interface{}, tag reflect.StructTag, topLevel bool) ([]byte, error) { - typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v)) - - switch { - case isModelType(typ): - if topLevel { - return json.Marshal(v) - } - - if isNil(typ, val) { - return []byte("null"), nil - } - - out := map[string]json.RawMessage{} - - for i := 0; i < typ.NumField(); i++ { - field := typ.Field(i) - fieldVal := val.Field(i) - - fieldName := field.Name - - omitEmpty := false - jsonTag := field.Tag.Get("json") - if jsonTag != "" { - for _, tag := range strings.Split(jsonTag, ",") { - if tag == "omitempty" { - omitEmpty = true - } else { - fieldName = tag - } - } - } - - if (isNil(field.Type, fieldVal) || isEmpty(field.Type, fieldVal)) && field.Tag.Get("const") == "" { - if omitEmpty { - continue - } - } - - if !field.IsExported() && field.Tag.Get("const") == "" { - continue - } - - additionalProperties := field.Tag.Get("additionalProperties") - if fieldName == "-" && additionalProperties == "" { - continue - } - - if additionalProperties == "true" { - if isNil(field.Type, fieldVal) { - continue - } - fieldVal := trueReflectValue(fieldVal) - if fieldVal.Type().Kind() != reflect.Map { - return nil, fmt.Errorf("additionalProperties must be a map") - } - - for _, key := range fieldVal.MapKeys() { - r, err := marshalValue(fieldVal.MapIndex(key).Interface(), field.Tag) - if err != nil { - return nil, err - } - - out[key.String()] = r - } - - continue - } - - var fv interface{} - - if field.IsExported() { - fv = fieldVal.Interface() - } else { - pt := reflect.New(typ).Elem() - pt.Set(val) - - pf := pt.Field(i) - - fv = reflect.NewAt(pf.Type(), unsafe.Pointer(pf.UnsafeAddr())).Elem().Interface() - } - - r, err := marshalValue(fv, field.Tag) - if err != nil { - return nil, err - } - - out[fieldName] = r - } - - return json.Marshal(out) - default: - return marshalValue(v, tag) - } -} - -func UnmarshalJSON(b []byte, v interface{}, tag reflect.StructTag, topLevel bool, disallowUnknownFields bool) error { - if reflect.TypeOf(v).Kind() != reflect.Ptr { - return fmt.Errorf("v must be a pointer") - } - - typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v)) - - switch { - case isModelType(typ): - if topLevel || bytes.Equal(b, []byte("null")) { - d := json.NewDecoder(bytes.NewReader(b)) - if disallowUnknownFields { - d.DisallowUnknownFields() - } - return d.Decode(v) - } - - var unmarhsaled map[string]json.RawMessage - - if err := json.Unmarshal(b, &unmarhsaled); err != nil { - return err - } - - var additionalPropertiesField *reflect.StructField - var additionalPropertiesValue *reflect.Value - - for i := 0; i < typ.NumField(); i++ { - field := typ.Field(i) - fieldVal := val.Field(i) - - fieldName := field.Name - - jsonTag := field.Tag.Get("json") - if jsonTag != "" { - for _, tag := range strings.Split(jsonTag, ",") { - if tag != "omitempty" { - fieldName = tag - } - } - } - - if field.Tag.Get("additionalProperties") == "true" { - additionalPropertiesField = &field - additionalPropertiesValue = &fieldVal - continue - } - - // If we receive a value for a const field ignore it but mark it as unmarshaled - if field.Tag.Get("const") != "" { - if r, ok := unmarhsaled[fieldName]; ok { - val := string(r) - - if strings.HasPrefix(val, `"`) && strings.HasSuffix(val, `"`) { - var err error - val, err = strconv.Unquote(val) - if err != nil { - return fmt.Errorf("failed to unquote const field `%s` value `%s`: %w", fieldName, val, err) - } - } - constValue := field.Tag.Get("const") - if val != constValue { - return fmt.Errorf("const field `%s` does not match expected value `%s` got `%s`", fieldName, constValue, val) - } - - delete(unmarhsaled, fieldName) - } - } else if !field.IsExported() { - continue - } - - value, ok := unmarhsaled[fieldName] - if !ok { - defaultTag := field.Tag.Get("default") - if defaultTag != "" { - value = handleDefaultConstValue(defaultTag, fieldVal.Interface(), field.Tag) - ok = true - } - } else { - delete(unmarhsaled, fieldName) - } - - if ok { - if err := unmarshalValue(value, fieldVal, field.Tag, disallowUnknownFields); err != nil { - return err - } - } - } - - keys := make([]string, 0, len(unmarhsaled)) - for k := range unmarhsaled { - keys = append(keys, k) - } - - if len(keys) > 0 { - if disallowUnknownFields && (additionalPropertiesField == nil || additionalPropertiesValue == nil) { - return fmt.Errorf("unknown fields: %v", keys) - } - - if additionalPropertiesField != nil && additionalPropertiesValue != nil { - typeOfMap := additionalPropertiesField.Type - if additionalPropertiesValue.Type().Kind() == reflect.Interface { - typeOfMap = reflect.TypeOf(map[string]interface{}{}) - } else if additionalPropertiesValue.Type().Kind() != reflect.Map { - return fmt.Errorf("additionalProperties must be a map") - } - - mapValue := reflect.MakeMap(typeOfMap) - - for key, value := range unmarhsaled { - val := reflect.New(typeOfMap.Elem()) - - if err := unmarshalValue(value, val, additionalPropertiesField.Tag, disallowUnknownFields); err != nil { - return err - } - - if val.Elem().Type().String() == typeOfMap.Elem().String() { - mapValue.SetMapIndex(reflect.ValueOf(key), val.Elem()) - } else { - mapValue.SetMapIndex(reflect.ValueOf(key), trueReflectValue(val)) - } - - } - if additionalPropertiesValue.Type().Kind() == reflect.Interface { - additionalPropertiesValue.Set(mapValue) - } else { - additionalPropertiesValue.Set(mapValue) - } - } - } - default: - return unmarshalValue(b, reflect.ValueOf(v), tag, disallowUnknownFields) - } - - return nil -} - -func marshalValue(v interface{}, tag reflect.StructTag) (json.RawMessage, error) { - constTag := tag.Get("const") - if constTag != "" { - return handleDefaultConstValue(constTag, v, tag), nil - } - - if isNil(reflect.TypeOf(v), reflect.ValueOf(v)) { - defaultTag := tag.Get("default") - if defaultTag != "" { - return handleDefaultConstValue(defaultTag, v, tag), nil - } - - return []byte("null"), nil - } - - typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v)) - switch typ.Kind() { - case reflect.Int64: - format := tag.Get("integer") - if format == "string" { - b := val.Interface().(int64) - return []byte(fmt.Sprintf(`"%d"`, b)), nil - } - case reflect.Float64: - format := tag.Get("number") - if format == "string" { - b := val.Interface().(float64) - return []byte(fmt.Sprintf(`"%g"`, b)), nil - } - case reflect.Map: - if isNil(typ, val) { - return []byte("null"), nil - } - - out := map[string]json.RawMessage{} - - for _, key := range val.MapKeys() { - itemVal := val.MapIndex(key) - - if isNil(itemVal.Type(), itemVal) { - out[key.String()] = []byte("null") - continue - } - - r, err := marshalValue(itemVal.Interface(), tag) - if err != nil { - return nil, err - } - - out[key.String()] = r - } - - return json.Marshal(out) - case reflect.Slice, reflect.Array: - if isNil(typ, val) { - return []byte("null"), nil - } - - out := []json.RawMessage{} - - for i := 0; i < val.Len(); i++ { - itemVal := val.Index(i) - - if isNil(itemVal.Type(), itemVal) { - out = append(out, []byte("null")) - continue - } - - r, err := marshalValue(itemVal.Interface(), tag) - if err != nil { - return nil, err - } - - out = append(out, r) - } - - return json.Marshal(out) - case reflect.Struct: - switch typ { - case reflect.TypeOf(time.Time{}): - return []byte(fmt.Sprintf(`"%s"`, val.Interface().(time.Time).Format(time.RFC3339Nano))), nil - case reflect.TypeOf(big.Int{}): - format := tag.Get("bigint") - if format == "string" { - b := val.Interface().(big.Int) - return []byte(fmt.Sprintf(`"%s"`, (&b).String())), nil - } - case reflect.TypeOf(decimal.Big{}): - format := tag.Get("decimal") - if format == "number" { - b := val.Interface().(decimal.Big) - f, ok := (&b).Float64() - if ok { - return []byte(b.String()), nil - } - - return []byte(fmt.Sprintf(`%f`, f)), nil - } - } - } - - return json.Marshal(v) -} - -func handleDefaultConstValue(tagValue string, val interface{}, tag reflect.StructTag) json.RawMessage { - if tagValue == "null" { - return []byte("null") - } - - typ := dereferenceTypePointer(reflect.TypeOf(val)) - switch typ { - case reflect.TypeOf(time.Time{}): - return []byte(fmt.Sprintf(`"%s"`, tagValue)) - case reflect.TypeOf(big.Int{}): - bigIntTag := tag.Get("bigint") - if bigIntTag == "string" { - return []byte(fmt.Sprintf(`"%s"`, tagValue)) - } - case reflect.TypeOf(int64(0)): - format := tag.Get("integer") - if format == "string" { - return []byte(fmt.Sprintf(`"%s"`, tagValue)) - } - case reflect.TypeOf(float64(0)): - format := tag.Get("number") - if format == "string" { - return []byte(fmt.Sprintf(`"%s"`, tagValue)) - } - case reflect.TypeOf(decimal.Big{}): - decimalTag := tag.Get("decimal") - if decimalTag != "number" { - return []byte(fmt.Sprintf(`"%s"`, tagValue)) - } - case reflect.TypeOf(types.Date{}): - return []byte(fmt.Sprintf(`"%s"`, tagValue)) - default: - if typ.Kind() == reflect.String { - return []byte(fmt.Sprintf("%q", tagValue)) - } - } - - return []byte(tagValue) -} - -func unmarshalValue(value json.RawMessage, v reflect.Value, tag reflect.StructTag, disallowUnknownFields bool) error { - if bytes.Equal(value, []byte("null")) { - if v.CanAddr() { - return json.Unmarshal(value, v.Addr().Interface()) - } else { - return json.Unmarshal(value, v.Interface()) - } - } - - typ := dereferenceTypePointer(v.Type()) - - switch typ.Kind() { - case reflect.Int64: - var b int64 - - format := tag.Get("integer") - if format == "string" { - var s string - if err := json.Unmarshal(value, &s); err != nil { - return err - } - - var err error - b, err = strconv.ParseInt(s, 10, 64) - if err != nil { - return fmt.Errorf("failed to parse string as int64: %w", err) - } - if v.Kind() == reflect.Ptr { - if v.IsNil() { - v.Set(reflect.New(typ)) - } - v = v.Elem() - } - - v.Set(reflect.ValueOf(b)) - return nil - } - case reflect.Float64: - var b float64 - - format := tag.Get("number") - if format == "string" { - var s string - if err := json.Unmarshal(value, &s); err != nil { - return err - } - - var err error - b, err = strconv.ParseFloat(s, 64) - if err != nil { - return fmt.Errorf("failed to parse string as float64: %w", err) - } - - if v.Kind() == reflect.Ptr { - if v.IsNil() { - v.Set(reflect.New(typ)) - } - v = v.Elem() - } - - v.Set(reflect.ValueOf(b)) - return nil - } - case reflect.Map: - if bytes.Equal(value, []byte("null")) || !isComplexValueType(dereferenceTypePointer(typ.Elem())) { - if v.CanAddr() { - return json.Unmarshal(value, v.Addr().Interface()) - } else { - return json.Unmarshal(value, v.Interface()) - } - } - - var unmarhsaled map[string]json.RawMessage - - if err := json.Unmarshal(value, &unmarhsaled); err != nil { - return err - } - - m := reflect.MakeMap(typ) - - for k, value := range unmarhsaled { - itemVal := reflect.New(typ.Elem()) - - if err := unmarshalValue(value, itemVal, tag, disallowUnknownFields); err != nil { - return err - } - - m.SetMapIndex(reflect.ValueOf(k), itemVal.Elem()) - } - - v.Set(m) - return nil - case reflect.Slice, reflect.Array: - var unmarshaled []json.RawMessage - - if err := json.Unmarshal(value, &unmarshaled); err != nil { - return err - } - - arrVal := reflect.MakeSlice(typ, len(unmarshaled), len(unmarshaled)) - - for index, value := range unmarshaled { - itemVal := reflect.New(typ.Elem()) - - if err := unmarshalValue(value, itemVal, tag, disallowUnknownFields); err != nil { - return err - } - - arrVal.Index(index).Set(itemVal.Elem()) - } - - if v.Kind() == reflect.Pointer { - if v.IsNil() { - v.Set(reflect.New(typ)) - } - v = v.Elem() - } - - v.Set(arrVal) - return nil - case reflect.Struct: - switch typ { - case reflect.TypeOf(time.Time{}): - var s string - if err := json.Unmarshal(value, &s); err != nil { - return err - } - - t, err := time.Parse(time.RFC3339Nano, s) - if err != nil { - return fmt.Errorf("failed to parse string as time.Time: %w", err) - } - - if v.Kind() == reflect.Ptr { - if v.IsNil() { - v.Set(reflect.New(typ)) - } - v = v.Elem() - } - - v.Set(reflect.ValueOf(t)) - return nil - case reflect.TypeOf(big.Int{}): - var b *big.Int - - format := tag.Get("bigint") - if format == "string" { - var s string - if err := json.Unmarshal(value, &s); err != nil { - return err - } - - var ok bool - b, ok = new(big.Int).SetString(s, 10) - if !ok { - return fmt.Errorf("failed to parse string as big.Int") - } - } else { - if err := json.Unmarshal(value, &b); err != nil { - return err - } - } - - if v.Kind() == reflect.Ptr && v.Elem().Kind() == reflect.Ptr { - v = v.Elem() - } - - v.Set(reflect.ValueOf(b)) - return nil - case reflect.TypeOf(decimal.Big{}): - var d *decimal.Big - format := tag.Get("decimal") - if format == "number" { - var ok bool - d, ok = new(decimal.Big).SetString(string(value)) - if !ok { - return fmt.Errorf("failed to parse number as decimal.Big") - } - } else { - if err := json.Unmarshal(value, &d); err != nil { - return err - } - } - - if v.Kind() == reflect.Ptr && v.Elem().Kind() == reflect.Ptr { - v = v.Elem() - } - - v.Set(reflect.ValueOf(d)) - return nil - case reflect.TypeOf(types.Date{}): - var s string - - if err := json.Unmarshal(value, &s); err != nil { - return err - } - - d, err := types.DateFromString(s) - if err != nil { - return fmt.Errorf("failed to parse string as types.Date: %w", err) - } - - if v.Kind() == reflect.Ptr { - if v.IsNil() { - v.Set(reflect.New(typ)) - } - v = v.Elem() - } - - v.Set(reflect.ValueOf(d)) - return nil - } - } - - var val interface{} - - if v.CanAddr() { - val = v.Addr().Interface() - } else { - val = v.Interface() - } - - d := json.NewDecoder(bytes.NewReader(value)) - if disallowUnknownFields { - d.DisallowUnknownFields() - } - return d.Decode(val) -} - -func dereferencePointers(typ reflect.Type, val reflect.Value) (reflect.Type, reflect.Value) { - if typ.Kind() == reflect.Ptr { - typ = typ.Elem() - val = val.Elem() - } else { - return typ, val - } - - return dereferencePointers(typ, val) -} - -func dereferenceTypePointer(typ reflect.Type) reflect.Type { - if typ.Kind() == reflect.Ptr { - typ = typ.Elem() - } else { - return typ - } - - return dereferenceTypePointer(typ) -} - -func isComplexValueType(typ reflect.Type) bool { - switch typ.Kind() { - case reflect.Struct: - switch typ { - case reflect.TypeOf(time.Time{}): - fallthrough - case reflect.TypeOf(big.Int{}): - fallthrough - case reflect.TypeOf(decimal.Big{}): - fallthrough - case reflect.TypeOf(types.Date{}): - return true - } - } - - return false -} - -func isModelType(typ reflect.Type) bool { - if isComplexValueType(typ) { - return false - } - - if typ.Kind() == reflect.Struct { - return true - } - - return false -} diff --git a/tests/mockserver/internal/sdk/utils/reflect.go b/tests/mockserver/internal/sdk/utils/reflect.go deleted file mode 100644 index 255f3dd7..00000000 --- a/tests/mockserver/internal/sdk/utils/reflect.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package utils - -import ( - "reflect" -) - -func isNil(typ reflect.Type, val reflect.Value) bool { - // `reflect.TypeOf(nil) == nil` so calling typ.Kind() will cause a nil pointer - // dereference panic. Catch it and return early. - // https://github.com/golang/go/issues/51649 - // https://github.com/golang/go/issues/54208 - if typ == nil { - return true - } - - if typ.Kind() == reflect.Ptr || typ.Kind() == reflect.Map || typ.Kind() == reflect.Slice || typ.Kind() == reflect.Interface { - return val.IsNil() - } - - return false -} - -func isEmpty(typ reflect.Type, val reflect.Value) bool { - if typ == nil { - return true - } - - switch typ.Kind() { - case reflect.Array, reflect.Map, reflect.Slice, reflect.String: - return val.Len() == 0 - } - - return false -} - -func trueReflectValue(val reflect.Value) reflect.Value { - kind := val.Type().Kind() - for kind == reflect.Interface || kind == reflect.Ptr { - innerVal := val.Elem() - if !innerVal.IsValid() { - break - } - val = innerVal - kind = val.Type().Kind() - } - return val -} diff --git a/tests/mockserver/internal/sdk/utils/sort.go b/tests/mockserver/internal/sdk/utils/sort.go deleted file mode 100644 index 6b265be7..00000000 --- a/tests/mockserver/internal/sdk/utils/sort.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package utils - -import ( - "regexp" - "sort" - "strings" -) - -// SortSerializedMaps will sort a given string, []string, or map[string]string -// such that all keys are ordered. This should only be used to simplify testing -// logic. -func SortSerializedMaps(input interface{}, regex string, delim string) interface{} { - sortString := func(input string) string { - r := regexp.MustCompile(regex) - - return replaceAllStringSubmatchFunc(r, input, func(matches []string) string { - result := matches[0] - - for i := 1; i < len(matches); i++ { - match := matches[i] - - pairs := []string{} - if strings.Contains(match, "=") { - pairs = strings.Split(match, delim) - - sort.SliceStable(pairs, func(i, j int) bool { - return strings.Split(pairs[i], "=")[0] < strings.Split(pairs[j], "=")[0] - }) - } else { - values := strings.Split(match, delim) - - if len(values) == 1 { - pairs = values - } else { - pairs = make([]string, len(values)/2) - for i := 0; i < len(values); i += 2 { - pairs[i/2] = values[i] + delim + values[i+1] - } - } - - sort.SliceStable(pairs, func(i, j int) bool { - return strings.Split(pairs[i], delim)[0] < strings.Split(pairs[j], delim)[0] - }) - } - - match = strings.Join(pairs, delim) - - result = strings.Replace(result, matches[i], match, 1) - } - - return result - }) - } - - switch input := input.(type) { - case string: - return sortString(input) - case []string: - for i, v := range input { - input[i] = sortString(v) - } - return input - case map[string]string: - for k, v := range input { - input[k] = sortString(v) - } - return input - default: - panic("unsupported type") - } -} - -func replaceAllStringSubmatchFunc(re *regexp.Regexp, str string, repl func([]string) string) string { - result := "" - lastIndex := 0 - - for _, v := range re.FindAllSubmatchIndex([]byte(str), -1) { - groups := []string{} - for i := 0; i < len(v); i += 2 { - if v[i] == -1 || v[i+1] == -1 { - groups = append(groups, "") - } else { - groups = append(groups, str[v[i]:v[i+1]]) - } - } - - result += str[lastIndex:v[0]] + repl(groups) - lastIndex = v[1] - } - - return result + str[lastIndex:] -} diff --git a/tests/mockserver/internal/server/doc.go b/tests/mockserver/internal/server/doc.go deleted file mode 100644 index 666dc109..00000000 --- a/tests/mockserver/internal/server/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -// Package server implements the HTTP server. -package server diff --git a/tests/mockserver/internal/server/generated_handlers.go b/tests/mockserver/internal/server/generated_handlers.go deleted file mode 100644 index 1ea16355..00000000 --- a/tests/mockserver/internal/server/generated_handlers.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package server - -import ( - "context" - - "mockserver/internal/handler" -) - -func (s *Server) registerGeneratedHandlers(ctx context.Context) { - s.logger.Debug("registering generated handlers") - - for _, h := range handler.GeneratedHandlers(ctx, s.httpFileDir, s.requestTracker) { - s.RegisterHandlerFunc(ctx, []string{h.Method}, h.Path, h.HandlerFunc()) - } -} diff --git a/tests/mockserver/internal/server/internal_handlers.go b/tests/mockserver/internal/server/internal_handlers.go deleted file mode 100644 index 1c248615..00000000 --- a/tests/mockserver/internal/server/internal_handlers.go +++ /dev/null @@ -1,343 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package server - -import ( - "bytes" - "context" - "fmt" - "html/template" - "io" - "net/http" - "path/filepath" - "strings" -) - -const ( - // Mock server internal route prefix to prevent naming collisions. - internalPathPrefix = "/_mockserver" -) - -// registerInternalHandlers adds any internal handlers, such as healthcheck -// endpoints and fallback handling. -func (s *Server) registerInternalHandlers(ctx context.Context) { - s.logger.Debug("registering internal handlers") - - // Healthcheck endpoint - s.RegisterHandlerFunc(ctx, []string{http.MethodGet}, internalPathPrefix+"/health", healthcheckHandler) - - // HTTP log index endpoint - s.RegisterHandlerFunc(ctx, []string{http.MethodGet}, internalPathPrefix+"/log", s.httpFileIndexHandler) - - // HTTP log operation endpoint - s.RegisterHandlerFunc(ctx, []string{http.MethodGet}, internalPathPrefix+"/log/{operationId}", s.httpOperationHandler) - - // Default all other requests to 404 Not Found - s.RegisterHandlerFunc(ctx, []string{}, "/", rootHandler) -} - -// healthcheckHandler returns a simple OK response. -func healthcheckHandler(w http.ResponseWriter, _ *http.Request) { - w.Header().Set("Content-Type", "text/plain; charset=utf-8") - w.WriteHeader(http.StatusOK) - fmt.Fprintln(w, "OK") -} - -// httpFileIndexHandler returns a HTML index page for all logged HTTP operations -// written to the HTTP file directory. -func (s *Server) httpFileIndexHandler(w http.ResponseWriter, _ *http.Request) { - operations, err := s.httpFileDir.Operations() - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation log error: %s", err), - http.StatusInternalServerError, - ) - - return - } - - type operationModel struct { - CallCount int64 - ID string - LogURL string - Method string - Path string - } - - type indexModel struct { - Operations []operationModel - } - - var index indexModel - - for _, operation := range operations { - index.Operations = append(index.Operations, operationModel{ - CallCount: operation.CallCount(), - ID: operation.Id(), - LogURL: internalPathPrefix + "/log/" + operation.Id(), - Method: operation.Method(), - Path: operation.Path(), - }) - } - - tmpl := template.New("index.html.tmpl") - tmpl.Funcs(template.FuncMap{ - "mod": func(i, j int) bool { return i%j == 0 }, - }) - _, err = tmpl.ParseFiles( - filepath.Join("internal", "server", "templates", "log", "style.css.tmpl"), - filepath.Join("internal", "server", "templates", "log", "index.html.tmpl"), - ) - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation log template error: %s", err), - http.StatusInternalServerError, - ) - - return - } - - var wBuf bytes.Buffer - - err = tmpl.Execute(&wBuf, index) - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation log template execution error: %s", err), - http.StatusInternalServerError, - ) - - return - } - - w.Header().Set("Content-Type", "text/html; charset=utf-8") - w.WriteHeader(http.StatusOK) - _, _ = wBuf.WriteTo(w) -} - -// httpOperationHandler returns a HTML page for HTTP request and response log files -// written to _debug. -func (s *Server) httpOperationHandler(w http.ResponseWriter, req *http.Request) { - operationId := req.PathValue("operationId") - - if operationId == "" { - http.Error(w, "operation logs not found", http.StatusNotFound) - - return - } - - operation, err := s.httpFileDir.Operation(operationId) - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation %s log error: %s", operationId, err), - http.StatusInternalServerError, - ) - - return - } - - type headerModel struct { - Key string - Values template.HTML - } - - type queryParameterModel struct { - Key string - Values template.HTML - } - - type operationCallModel struct { - Call int64 - ID string - LogOperationURL string - - RawRequest template.HTML - RawResponse template.HTML - - RequestBody string - RequestHeaders []headerModel - RequestQueryParameters []queryParameterModel - - ResponseBody string - ResponseHeaders []headerModel - ResponseStatus string - } - - type operationDataModel struct { - Calls []operationCallModel - ID string - LogIndexURL string - RequestMethod string - RequestPath string - } - - operationData := operationDataModel{ - ID: operationId, - LogIndexURL: internalPathPrefix + "/log", - RequestMethod: operation.Method(), - RequestPath: operation.Path(), - } - - for i := range operation.CallCount() { - call := i + 1 - - callReqRaw, err := operation.RawRequest(call) - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation %s call %d log raw request error: %s", operationId, call, err), - http.StatusInternalServerError, - ) - - return - } - - callReq, err := operation.Request(call) - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation %s call %d log request error: %s", operationId, call, err), - http.StatusInternalServerError, - ) - - return - } - - callReqBody, err := io.ReadAll(callReq.Body) - defer callReq.Body.Close() - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation %s call %d log request body error: %s", operationId, call, err), - http.StatusInternalServerError, - ) - - return - } - - callRespRaw, err := operation.RawResponse(call) - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation %s call %d log response error: %s", operationId, call, err), - http.StatusInternalServerError, - ) - - return - } - - callResp, err := operation.Response(call) - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation %s call %d log response error: %s", operationId, call, err), - http.StatusInternalServerError, - ) - - return - } - - callRespBody, err := io.ReadAll(callResp.Body) - defer callReq.Body.Close() - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation %s call %d log response body error: %s", operationId, call, err), - http.StatusInternalServerError, - ) - - return - } - - operationCall := operationCallModel{ - Call: call, - LogOperationURL: internalPathPrefix + "/log/" + operationId, - - RawRequest: template.HTML(strings.ReplaceAll(string(callReqRaw), "\r\n", "
")), - RawResponse: template.HTML(strings.ReplaceAll(string(callRespRaw), "\r\n", "
")), - - RequestBody: string(callReqBody), - ResponseBody: string(callRespBody), - ResponseStatus: callResp.Status, - } - - for key, values := range callReq.URL.Query() { - operationCall.RequestQueryParameters = append(operationCall.RequestQueryParameters, queryParameterModel{ - Key: key, - Values: template.HTML(strings.Join(values, "
")), - }) - } - - for key, values := range callReq.Header { - operationCall.RequestHeaders = append(operationCall.RequestHeaders, headerModel{ - Key: key, - Values: template.HTML(strings.Join(values, "
")), - }) - } - - for key, values := range callResp.Header { - operationCall.ResponseHeaders = append(operationCall.ResponseHeaders, headerModel{ - Key: key, - Values: template.HTML(strings.Join(values, "
")), - }) - } - - operationData.Calls = append(operationData.Calls, operationCall) - } - - tmpl := template.New("operation.html.tmpl") - tmpl.Funcs(template.FuncMap{ - "mod": func(i, j int) bool { return i%j == 0 }, - }) - _, err = tmpl.ParseFiles( - filepath.Join("internal", "server", "templates", "log", "style.css.tmpl"), - filepath.Join("internal", "server", "templates", "log", "operation.html.tmpl"), - ) - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation log template error: %s", err), - http.StatusInternalServerError, - ) - - return - } - - var wBuf bytes.Buffer - - err = tmpl.Execute(&wBuf, operationData) - - if err != nil { - http.Error( - w, - fmt.Sprintf("operation log template execution error: %s", err), - http.StatusInternalServerError, - ) - - return - } - - w.Header().Set("Content-Type", "text/html; charset=utf-8") - w.WriteHeader(http.StatusOK) - _, _ = wBuf.WriteTo(w) -} - -// rootHandler returns a slightly customized [http.NotFoundHandler], saying -// "path" instead of "page". -func rootHandler(w http.ResponseWriter, _ *http.Request) { - http.Error(w, "path not found", http.StatusNotFound) -} diff --git a/tests/mockserver/internal/server/server.go b/tests/mockserver/internal/server/server.go deleted file mode 100644 index 12239611..00000000 --- a/tests/mockserver/internal/server/server.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package server - -import ( - "context" - "errors" - "fmt" - "log/slog" - "mockserver/internal/logging" - "mockserver/internal/tracking" - "net/http" - "strings" - "time" - - "github.com/gorilla/mux" -) - -const ( - // Default address for server listening. - DefaultAddress = ":18080" -) - -// Server implements the HTTP server. -type Server struct { - // Address for server listening. - address string - - // Directory for raw HTTP request and response files. - httpFileDir *logging.HTTPFileDirectory - - // Logger implementation. - logger *slog.Logger - - // Underlying mux implementation. - // Based on gorilla mux as the native mux suffered from issues with ambiguous paths and different http methods - // eg - panic: pattern "HEAD /v8/artifacts/{hash}" (registered at /usr/src/app/internal/server/server.go:104) conflicts with pattern "GET /v8/artifacts/status" (registered at /usr/src/app/internal/server/server.go:104): HEAD /v8/artifacts/{hash} matches fewer methods than GET /v8/artifacts/status, but has a more general path pattern - mux *mux.Router - - // Underlying server implementation. - server *http.Server - - requestTracker *tracking.RequestTracker -} - -// NewServer creates a new Server instance. -func NewServer(ctx context.Context, opts ...ServerOption) (*Server, error) { - // Initialize with defaults. - result := &Server{ - address: DefaultAddress, - logger: slog.Default(), - mux: mux.NewRouter(), - requestTracker: tracking.New(), - } - - // Customize based on ServerOption. - for _, opt := range opts { - err := opt(result) - - if err != nil { - return result, err - } - } - - result.server = &http.Server{ - Addr: result.address, - Handler: logging.HTTPLoggerHandler(result.logger, result.mux), - ErrorLog: slog.NewLogLogger(result.logger.Handler(), slog.LevelError), - } - - httpFileDir, err := logging.NewHTTPFileDirectory("") - - if err != nil { - return result, err - } - - err = httpFileDir.Clean() - - if err != nil { - return result, err - } - - result.httpFileDir = httpFileDir - - result.registerGeneratedHandlers(ctx) - result.registerInternalHandlers(ctx) - - return result, err -} - -// Address returns the server address including protocol, hostname, and port. -func (s *Server) Address() string { - return "http://localhost" + s.address -} - -// RegisterHandlerFunc adds a new HTTP handler function for the given methods and path. -func (s *Server) RegisterHandlerFunc(ctx context.Context, methods []string, path string, handlerFunc http.HandlerFunc) { - s.logger.DebugContext(ctx, fmt.Sprintf("registering handler for %s %s", strings.Join(methods, ", "), path)) - - r := s.mux.HandleFunc(path, handlerFunc) - if len(methods) > 0 { - r.Methods(methods...) - } -} - -// Serve starts the server. -func (s *Server) Serve(ctx context.Context) error { - s.logger.InfoContext(ctx, "starting server with address "+s.server.Addr) - - err := s.server.ListenAndServe() - - if errors.Is(err, http.ErrServerClosed) { - return nil - } - - return fmt.Errorf("error running server: %w", err) -} - -// Shutdown gracefully stops the server. -func (s *Server) Shutdown(ctx context.Context) error { - s.logger.WarnContext(ctx, "shutting down server") - s.server.SetKeepAlivesEnabled(false) - - ctx, cancel := context.WithTimeout(ctx, 5*time.Second) - defer cancel() - - err := s.server.Shutdown(ctx) - - if err != nil { - return fmt.Errorf("error shutting down server: %w", err) - } - - return nil -} diff --git a/tests/mockserver/internal/server/server_option.go b/tests/mockserver/internal/server/server_option.go deleted file mode 100644 index ff85a678..00000000 --- a/tests/mockserver/internal/server/server_option.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package server - -import ( - "log/slog" -) - -// ServerOption is a function which modifies the Server. -type ServerOption func(*Server) error - -// WithAddress sets the listening address for a Server. By default, the server -// address is :18080. -func WithAddress(address string) ServerOption { - return func(s *Server) error { - s.address = address - - return nil - } -} - -// WithLogger sets the logger implementation for a Server. By default, the -// server logger is [slog.Default]. -func WithLogger(logger *slog.Logger) ServerOption { - return func(s *Server) error { - s.logger = logger - - return nil - } -} diff --git a/tests/mockserver/internal/server/templates/log/index.html.tmpl b/tests/mockserver/internal/server/templates/log/index.html.tmpl deleted file mode 100644 index 8b1124e5..00000000 --- a/tests/mockserver/internal/server/templates/log/index.html.tmpl +++ /dev/null @@ -1,22 +0,0 @@ - - - Operation Logs - - - -

// Speakeasy

-

Operation Logs

- - - {{ range $idx, $o := .Operations }} - - - - - - {{ end }} -
OperationRequestCalls
{{ .ID }}{{ .Method }} {{ .Path }}{{ .CallCount }}
- - diff --git a/tests/mockserver/internal/server/templates/log/operation.html.tmpl b/tests/mockserver/internal/server/templates/log/operation.html.tmpl deleted file mode 100644 index a54a2adc..00000000 --- a/tests/mockserver/internal/server/templates/log/operation.html.tmpl +++ /dev/null @@ -1,93 +0,0 @@ - - - Operation Logs: {{ .ID }} - - - -

// Speakeasy

-

Operation Logs: {{ .ID }}

-

{{ .RequestMethod }} {{ .RequestPath }}

-

Back to All Operation Logs

-
- {{ range $idx, $c := .Calls }} -
- {{ if (ne (len $.Calls) 1) }} -

Call {{ .Call }}

- {{ end }} -
-

Request

- - {{ if (gt (len .RequestQueryParameters) 0) }} -
-

Query Parameters

- - - {{ range $idx, $p := .RequestQueryParameters }} - - - - - {{ end }} -
KeyValue
{{ .Key }}{{ .Values }}
-
- {{ end }} -
-

Headers

- - - {{ range $idx, $h := .RequestHeaders }} - - - - - {{ end }} -
KeyValue(s)
{{ .Key }}{{ .Values }}
-
- {{ if (gt (len .RequestBody) 0) }} -
-

Body

-

{{ .RequestBody }}

-
- {{ end }} -

-

- Raw Request -
{{ .RawRequest }}
-
-

-
-
-

Response

-

{{ .ResponseStatus }}

-
-

Headers

- - - {{ range $idx, $h := .ResponseHeaders }} - - - - - {{ end }} -
KeyValue(s)
{{ .Key }}{{ .Values }}
-
- {{ if (gt (len .ResponseBody) 0) }} -
-

Body

-

{{ .ResponseBody }}

-
- {{ end }} -

-

- Raw Response -
{{ .RawResponse }}
-
-

-
-
- {{ end }} -
- - diff --git a/tests/mockserver/internal/server/templates/log/style.css.tmpl b/tests/mockserver/internal/server/templates/log/style.css.tmpl deleted file mode 100644 index 5490930e..00000000 --- a/tests/mockserver/internal/server/templates/log/style.css.tmpl +++ /dev/null @@ -1,64 +0,0 @@ -{{ define "style" }} -a { - color: rgba(251, 227, 50, 1.0); -} -body { - background: black; - font-family: Arial, Helvetica, sans-serif; -} -code { - color: white; -} -details > div { - border-left: 1px solid gray; - margin-left: 10px; - padding: 10px; -} -div { - width: fit-content; -} -div.operation-call.odd { - background-color: rgba(251, 227, 50, 0.1); -} -h1 { - color: hsl(53, 96%, 59%); -} -h2 { - color: rgba(255, 255, 255, 1.0); -} -h3 { - color: rgba(255, 255, 255, 0.75); -} -h4 { - color: rgba(255, 255, 255, 0.50); -} -p { - color: white; - padding-left: 10px; -} -summary { - color: gray; - font-weight: bold; - margin-bottom: 5px; -} -table { - border-collapse: collapse; - margin: 5px; -} -th { - border-bottom: 1px solid gray; - color: white; - padding: 10px; - text-align: left; -} -td { - color: white; - padding: 10px; -} -tr.even { - background-color: rgba(255, 255, 255, 0.0); -} -tr.odd { - background-color: rgba(255, 255, 255, 0.1); -} -{{ end }} diff --git a/tests/mockserver/internal/tracking/requesttracker.go b/tests/mockserver/internal/tracking/requesttracker.go deleted file mode 100644 index 1d9131d0..00000000 --- a/tests/mockserver/internal/tracking/requesttracker.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package tracking - -import ( - "fmt" - "time" - - cache "github.com/go-pkgz/expirable-cache/v3" -) - -type RequestTracker struct { - cache cache.Cache[string, *testEntry] -} - -type testEntry struct { - name string - id string - count int - created time.Time -} - -func New() *RequestTracker { - return &RequestTracker{ - cache: cache.NewCache[string, *testEntry]().WithTTL(5 * time.Minute), - } -} - -func (t *RequestTracker) GetRequestCount(testName, instanceID string) int { - key := fmt.Sprintf("%s-%s", testName, instanceID) - - entry, ok := t.cache.Get(key) - if !ok { - entry = &testEntry{ - name: testName, - id: instanceID, - count: 0, - created: time.Now(), - } - } - - count := entry.count - entry.count++ - t.cache.Set(key, entry, 0) - - return count -} diff --git a/tests/mockserver/main.go b/tests/mockserver/main.go deleted file mode 100644 index 2270443b..00000000 --- a/tests/mockserver/main.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package main - -import ( - "context" - "flag" - "fmt" - "os" - "os/signal" - "strings" - - "mockserver/internal/logging" - "mockserver/internal/server" -) - -func main() { - ctx := context.Background() - - address := flag.String("address", server.DefaultAddress, fmt.Sprintf("server listen address (default: %s)", server.DefaultAddress)) - logFormat := flag.String("log-format", logging.DefaultFormat, fmt.Sprintf("logging format (default: %s, supported: %s)", logging.DefaultFormat, strings.Join(logging.Formats(), ", "))) - logLevel := flag.String("log-level", logging.DefaultLevel, fmt.Sprintf("logging level (default: %s, supported: %s)", logging.DefaultLevel, strings.Join(logging.Levels(), ", "))) - - flag.Parse() - - logger, err := logging.NewLogger(os.Stdout, *logFormat, *logLevel) - - if err != nil { - fmt.Fprintf(os.Stderr, "error setting up logging: %s", err) - os.Exit(1) - } - - serverOpts := []server.ServerOption{ - server.WithAddress(*address), - server.WithLogger(logger), - } - - s, err := server.NewServer(ctx, serverOpts...) - - if err != nil { - logger.ErrorContext(ctx, err.Error()) - os.Exit(1) - } - - finishedShutdown := make(chan struct{}) - startShutdown := make(chan os.Signal, 1) - signal.Notify(startShutdown, os.Interrupt) - - go func() { - <-startShutdown - - logger.WarnContext(ctx, "server received interrupt") - - err := s.Shutdown(ctx) - - if err != nil { - logger.Error(err.Error()) - os.Exit(1) - } - - close(finishedShutdown) - }() - - err = s.Serve(ctx) - - if err != nil { - logger.ErrorContext(ctx, err.Error()) - os.Exit(1) - } - - <-finishedShutdown - - logger.InfoContext(ctx, "server stopped") -}